Skip to content
Browse files

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

Fix ClientRectangle setter on Windows (WinGL) & Linux (X11)
  • Loading branch information...
1 parent a665122 commit 9a399492495842474403dae89f89ece7139c5a47 @dellis1972 dellis1972 committed with Mar 10, 2013
Showing with 7 additions and 1 deletion.
  1. +5 −1 Source/OpenTK/Platform/Windows/WinGLNative.cs
  2. +2 −0 Source/OpenTK/Platform/X11/X11GLNative.cs
View
6 Source/OpenTK/Platform/Windows/WinGLNative.cs
@@ -730,7 +730,11 @@ public Rectangle ClientRectangle
}
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
2 Source/OpenTK/Platform/X11/X11GLNative.cs
@@ -994,6 +994,8 @@ public Rectangle ClientRectangle
{
using (new XLock(window.Display))
{
+ Functions.XMoveWindow(window.Display, window.WindowHandle,
+ value.X, value.Y);
Functions.XResizeWindow(window.Display, window.WindowHandle,
value.Width, value.Height);
}

0 comments on commit 9a39949

Please sign in to comment.
Something went wrong with that request. Please try again.