aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Krieger <pierre.krieger1708@gmail.com>2015-03-30 12:56:08 +0200
committerPierre Krieger <pierre.krieger1708@gmail.com>2015-03-30 12:56:08 +0200
commit9bef21048ef03ecfa8e0ca46ed700cabf95a9f30 (patch)
treeb8f5664239b5f0ab27f2dc6e72ad0686ebcd20e6
parentbae1e42b8b27ad2e66fa50c227d4ead0eae80993 (diff)
downloadglutin-9bef21048ef03ecfa8e0ca46ed700cabf95a9f30.tar.gz
glutin-9bef21048ef03ecfa8e0ca46ed700cabf95a9f30.zip
Fix wrong grabbing rect
-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"));
}