summaryrefslogtreecommitdiff
path: root/src/video/win32_v.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video/win32_v.cpp')
-rw-r--r--src/video/win32_v.cpp24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index 6e7d33b9f..4dcc9eb70 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -747,25 +747,11 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
SetTimer(hwnd, TID_POLLMOUSE, MOUSE_POLL_DELAY, (TIMERPROC)TrackMouseTimerProc);
}
- if (_cursor.fix_at) {
- int dx = x - _cursor.pos.x;
- int dy = y - _cursor.pos.y;
- if (dx != 0 || dy != 0) {
- _cursor.delta.x = dx;
- _cursor.delta.y = dy;
-
- pt.x = _cursor.pos.x;
- pt.y = _cursor.pos.y;
-
- ClientToScreen(hwnd, &pt);
- SetCursorPos(pt.x, pt.y);
- }
- } else {
- _cursor.delta.x = x - _cursor.pos.x;
- _cursor.delta.y = y - _cursor.pos.y;
- _cursor.pos.x = x;
- _cursor.pos.y = y;
- _cursor.dirty = true;
+ if (_cursor.UpdateCursorPosition(x, y, true)) {
+ pt.x = _cursor.pos.x;
+ pt.y = _cursor.pos.y;
+ ClientToScreen(hwnd, &pt);
+ SetCursorPos(pt.x, pt.y);
}
MyShowCursor(false);
HandleMouseEvents();