aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/win32/mod.rs4
1 files changed, 3 insertions, 1 deletions
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"));
}