mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-16 10:38:06 -05:00
Don't call ReleaseCapture() on any mouse-button-up event. Instead,
only call it when the _last_ mouse button comes back up. Otherwise, xterm mouse tracking will lose a button-up event if you press down two buttons, move the mouse outside the window, then release them one at a time. [originally from svn r8425]
This commit is contained in:
parent
464aa76aaf
commit
9b2515f97e
@ -2335,26 +2335,32 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
|||||||
switch (message) {
|
switch (message) {
|
||||||
case WM_LBUTTONDOWN:
|
case WM_LBUTTONDOWN:
|
||||||
button = MBT_LEFT;
|
button = MBT_LEFT;
|
||||||
|
wParam |= MK_LBUTTON;
|
||||||
press = 1;
|
press = 1;
|
||||||
break;
|
break;
|
||||||
case WM_MBUTTONDOWN:
|
case WM_MBUTTONDOWN:
|
||||||
button = MBT_MIDDLE;
|
button = MBT_MIDDLE;
|
||||||
|
wParam |= MK_MBUTTON;
|
||||||
press = 1;
|
press = 1;
|
||||||
break;
|
break;
|
||||||
case WM_RBUTTONDOWN:
|
case WM_RBUTTONDOWN:
|
||||||
button = MBT_RIGHT;
|
button = MBT_RIGHT;
|
||||||
|
wParam |= MK_RBUTTON;
|
||||||
press = 1;
|
press = 1;
|
||||||
break;
|
break;
|
||||||
case WM_LBUTTONUP:
|
case WM_LBUTTONUP:
|
||||||
button = MBT_LEFT;
|
button = MBT_LEFT;
|
||||||
|
wParam &= ~MK_LBUTTON;
|
||||||
press = 0;
|
press = 0;
|
||||||
break;
|
break;
|
||||||
case WM_MBUTTONUP:
|
case WM_MBUTTONUP:
|
||||||
button = MBT_MIDDLE;
|
button = MBT_MIDDLE;
|
||||||
|
wParam &= ~MK_MBUTTON;
|
||||||
press = 0;
|
press = 0;
|
||||||
break;
|
break;
|
||||||
case WM_RBUTTONUP:
|
case WM_RBUTTONUP:
|
||||||
button = MBT_RIGHT;
|
button = MBT_RIGHT;
|
||||||
|
wParam &= ~MK_RBUTTON;
|
||||||
press = 0;
|
press = 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -2413,6 +2419,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
|||||||
TO_CHR_X(X_POS(lParam)),
|
TO_CHR_X(X_POS(lParam)),
|
||||||
TO_CHR_Y(Y_POS(lParam)), wParam & MK_SHIFT,
|
TO_CHR_Y(Y_POS(lParam)), wParam & MK_SHIFT,
|
||||||
wParam & MK_CONTROL, is_alt_pressed());
|
wParam & MK_CONTROL, is_alt_pressed());
|
||||||
|
if (!(wParam & (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)))
|
||||||
ReleaseCapture();
|
ReleaseCapture();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user