Merge pull request #1 from elisee/fix-client-rectangle-setter

Fix ClientRectangle setter on Windows (WinGL) & Linux (X11)
This commit is contained in:
Dean Ellis 2013-03-10 12:33:24 -07:00 committed by Andy Korth
parent a665122202
commit 9a39949249
2 changed files with 7 additions and 1 deletions

View file

@ -730,7 +730,11 @@ namespace OpenTK.Platform.Windows
} }
set set
{ {
ClientSize = value.Size; WindowStyle style = (WindowStyle)Functions.GetWindowLong(window.WindowHandle, GetWindowLongOffsets.STYLE);
Win32Rectangle rect = Win32Rectangle.From(value);
Functions.AdjustWindowRect(ref rect, style, false);
Location = new Point(rect.left, rect.top);
Size = new Size(rect.Width, rect.Height);
} }
} }

View file

@ -994,6 +994,8 @@ namespace OpenTK.Platform.X11
{ {
using (new XLock(window.Display)) using (new XLock(window.Display))
{ {
Functions.XMoveWindow(window.Display, window.WindowHandle,
value.X, value.Y);
Functions.XResizeWindow(window.Display, window.WindowHandle, Functions.XResizeWindow(window.Display, window.WindowHandle,
value.Width, value.Height); value.Width, value.Height);
} }