diff --git a/Source/OpenTK/Platform/Windows/API.cs b/Source/OpenTK/Platform/Windows/API.cs index db8fc961..e831d1f2 100644 --- a/Source/OpenTK/Platform/Windows/API.cs +++ b/Source/OpenTK/Platform/Windows/API.cs @@ -2635,13 +2635,6 @@ namespace OpenTK.Platform.Windows [StructLayout(LayoutKind.Sequential)] internal struct Win32Rectangle { - internal Win32Rectangle(int width, int height) - { - left = top = 0; - right = width; - bottom = height; - } - /// /// Specifies the x-coordinate of the upper-left corner of the rectangle. /// diff --git a/Source/OpenTK/Platform/Windows/WinGLNative.cs b/Source/OpenTK/Platform/Windows/WinGLNative.cs index 61814c14..b433cb8f 100644 --- a/Source/OpenTK/Platform/Windows/WinGLNative.cs +++ b/Source/OpenTK/Platform/Windows/WinGLNative.cs @@ -647,10 +647,12 @@ namespace OpenTK.Platform.Windows void GrabCursor() { - Win32Rectangle rect = Win32Rectangle.From(ClientRectangle); - Point pos = PointToScreen(new Point(rect.left, rect.top)); + Point pos = PointToScreen(new Point(ClientRectangle.X, ClientRectangle.Y)); + Win32Rectangle rect = new Win32Rectangle(); rect.left = pos.X; + rect.right = pos.X + ClientRectangle.Width; rect.top = pos.Y; + rect.bottom = pos.Y + ClientRectangle.Height; if (!Functions.ClipCursor(ref rect)) Debug.WriteLine(String.Format("Failed to grab cursor. Error: {0}", Marshal.GetLastWin32Error()));