From 9bef21048ef03ecfa8e0ca46ed700cabf95a9f30 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Mon, 30 Mar 2015 12:56:08 +0200 Subject: Fix wrong grabbing rect --- src/win32/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/win32') diff --git a/src/win32/mod.rs b/src/win32/mod.rs index c0708b8..e20d8b7 100644 --- a/src/win32/mod.rs +++ b/src/win32/mod.rs @@ -292,9 +292,11 @@ impl Window { unsafe { user32::SetCursor(ptr::null_mut()); let mut rect = mem::uninitialized(); - if user32::GetWindowRect(self.window.0, &mut rect) == 0 { + if user32::GetClientRect(self.window.0, &mut rect) == 0 { return Err(format!("GetWindowRect failed")); } + user32::ClientToScreen(self.window.0, mem::transmute(&mut rect.left)); + user32::ClientToScreen(self.window.0, mem::transmute(&mut rect.right)); if user32::ClipCursor(&rect) == 0 { return Err(format!("ClipCursor failed")); } -- cgit v1.2.3