mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 00:06:44 -04:00
windisplay: Fix M_confined mode confining cursor to incorrect region
It should be confined to the client rect, not the window rect. Fixes #929
This commit is contained in:
parent
c59a039fa8
commit
4b00f9e660
@ -1311,11 +1311,8 @@ track_mouse_leaving(HWND hwnd) {
|
|||||||
bool WinGraphicsWindow::
|
bool WinGraphicsWindow::
|
||||||
confine_cursor() {
|
confine_cursor() {
|
||||||
RECT clip;
|
RECT clip;
|
||||||
if (!GetWindowRect(_hWnd, &clip)) {
|
get_client_rect_screen(_hWnd, &clip);
|
||||||
windisplay_cat.warning()
|
|
||||||
<< "GetWindowRect() failed, cannot confine cursor.\n";
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
windisplay_cat.info()
|
windisplay_cat.info()
|
||||||
<< "ClipCursor() to " << clip.left << "," << clip.top << " to "
|
<< "ClipCursor() to " << clip.left << "," << clip.top << " to "
|
||||||
<< clip.right << "," << clip.bottom << endl;
|
<< clip.right << "," << clip.bottom << endl;
|
||||||
@ -1328,7 +1325,6 @@ confine_cursor() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempts to set this window as the "focus" window, so that keyboard events
|
* Attempts to set this window as the "focus" window, so that keyboard events
|
||||||
|
Loading…
x
Reference in New Issue
Block a user