mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 08:15:18 -04:00
windisplay: Only release capture when last mouse button is released
This fixes issues with lost up events when dragging out of the window with multiple buttons held Fixes #1396
This commit is contained in:
parent
2c9deaaaf0
commit
8a46c3dc64
@ -1671,7 +1671,9 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
|
||||
if (_lost_keypresses) {
|
||||
resend_lost_keypresses();
|
||||
}
|
||||
ReleaseCapture();
|
||||
if (wparam == 0) {
|
||||
ReleaseCapture();
|
||||
}
|
||||
_input->button_up(MouseButton::button(0), get_message_time());
|
||||
return 0;
|
||||
|
||||
@ -1679,7 +1681,9 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
|
||||
if (_lost_keypresses) {
|
||||
resend_lost_keypresses();
|
||||
}
|
||||
ReleaseCapture();
|
||||
if (wparam == 0) {
|
||||
ReleaseCapture();
|
||||
}
|
||||
_input->button_up(MouseButton::button(1), get_message_time());
|
||||
return 0;
|
||||
|
||||
@ -1687,7 +1691,9 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
|
||||
if (_lost_keypresses) {
|
||||
resend_lost_keypresses();
|
||||
}
|
||||
ReleaseCapture();
|
||||
if (wparam == 0) {
|
||||
ReleaseCapture();
|
||||
}
|
||||
_input->button_up(MouseButton::button(2), get_message_time());
|
||||
return 0;
|
||||
|
||||
@ -1696,7 +1702,9 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
|
||||
if (_lost_keypresses) {
|
||||
resend_lost_keypresses();
|
||||
}
|
||||
ReleaseCapture();
|
||||
if (wparam == 0) {
|
||||
ReleaseCapture();
|
||||
}
|
||||
int whichButton = GET_XBUTTON_WPARAM(wparam);
|
||||
if (whichButton == XBUTTON1) {
|
||||
_input->button_up(MouseButton::button(3), get_message_time());
|
||||
|
Loading…
x
Reference in New Issue
Block a user