Let's try another way to handle the trap cursor support for windows.

Closes ticket:2813
master
vexed 2011-07-18 20:42:58 -04:00
parent 1bc2a38b04
commit c10d9ef8d4
1 changed files with 7 additions and 4 deletions

View File

@ -28,10 +28,13 @@ void QtGameWidget::trapMouse()
} while (result != GrabSuccess && count < 15);
#elif defined(WZ_WS_WIN32)
RECT lpRect;
lpRect.top = y();
lpRect.left = x();
lpRect.bottom = y() + size().height();
lpRect.right = x() + size().width();
QRect qRect = QtGameWidget::geometry();
lpRect.top = qRect.top();
lpRect.left = qRect.left();
lpRect.bottom = qRect.bottom();
lpRect.right = qRect.right();
ClipCursor(&lpRect);
#endif
mCursorTrapped = true;