* Platform/MacOS/CarbonGLNative.cs: Fix width/height properties on Mac OS X.

This commit is contained in:
kanato 2010-01-11 22:08:00 +00:00
parent 6d6ad9646a
commit ea5b4f9f06

View file

@ -647,6 +647,14 @@ namespace OpenTK.Platform.MacOS
API.SizeWindow(window.WindowRef, width, height, true); API.SizeWindow(window.WindowRef, width, height, true);
} }
void SetClientSize(short width, short height)
{
if (WindowState == WindowState.Fullscreen)
return;
API.SizeWindow(window.WindowRef, width, height, true);
}
protected void OnResize() protected void OnResize()
{ {
LoadSize(); LoadSize();
@ -877,21 +885,21 @@ namespace OpenTK.Platform.MacOS
public int Width public int Width
{ {
get { return Bounds.Width; } get { return ClientRectangle.Width; }
set { Size = new Size(value, Height); } set { SetClientSize((short)value, (short)Height); }
} }
public int Height public int Height
{ {
get { return Bounds.Height; } get { return ClientRectangle.Height; }
set { Size = new Size(Width, value); } set { SetClientSize((short)Width, (short)value); }
} }
public int X public int X
{ {
get get
{ {
return bounds.X; return ClientRectangle.X;
} }
set set
{ {
@ -903,7 +911,7 @@ namespace OpenTK.Platform.MacOS
{ {
get get
{ {
return bounds.Y; return ClientRectangle.Y;
} }
set set
{ {