Skip to content

Commit c10d9ef

Browse files
committed
Let's try another way to handle the trap cursor support for windows.
Closes ticket:2813
1 parent 1bc2a38 commit c10d9ef

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/qtgame/qtgame.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@ void QtGameWidget::trapMouse()
2828
} while (result != GrabSuccess && count < 15);
2929
#elif defined(WZ_WS_WIN32)
3030
RECT lpRect;
31-
lpRect.top = y();
32-
lpRect.left = x();
33-
lpRect.bottom = y() + size().height();
34-
lpRect.right = x() + size().width();
31+
QRect qRect = QtGameWidget::geometry();
32+
33+
lpRect.top = qRect.top();
34+
lpRect.left = qRect.left();
35+
lpRect.bottom = qRect.bottom();
36+
lpRect.right = qRect.right();
37+
3538
ClipCursor(&lpRect);
3639
#endif
3740
mCursorTrapped = true;

0 commit comments

Comments
 (0)