diff options
| author | Aldrik Ramaekers <aldrik.ramaekers@protonmail.com> | 2020-06-27 12:37:08 +0200 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik.ramaekers@protonmail.com> | 2020-06-27 12:37:08 +0200 |
| commit | b9f5d3754598f4724193920c189e4de6d3025259 (patch) | |
| tree | 3431fdb216fa381365521b3ceee69fcd62567bb0 | |
| parent | eaeed7631848eb7885fcb2dc6772bd6a777f101b (diff) | |
work
| -rw-r--r-- | src/windows/platform.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/windows/platform.c b/src/windows/platform.c index 06384d3..29e8970 100644 --- a/src/windows/platform.c +++ b/src/windows/platform.c @@ -888,9 +888,15 @@ void platform_handle_events(platform_window *window, mouse_input *mouse, keyboar RECT rec;
GetWindowRect(window->window_handle, &rec);
+
POINT p;
GetCursorPos(&p);
+ ScreenToClient(current_window_to_handle->window_handle, &p);
+
+ mouse->y = p.y;
+ mouse->x = p.x;
+#if 0
if (current_window_to_handle->flags & FLAGS_GLOBAL_MOUSE)
mouse->x = p.x - rec.left;
else
@@ -900,6 +906,7 @@ void platform_handle_events(platform_window *window, mouse_input *mouse, keyboar mouse->y = p.y - rec.top;
else
mouse->y = p.y - rec.top - GetSystemMetrics(SM_CYSIZE) - GetSystemMetrics(SM_CYFRAME);
+#endif
}
#endif
|
