https://bugs.freedesktop.org/show_bug.cgi?id=4538 Fix mouse button release
on multiwindows scrolling.
This commit is contained in:
parent
06f01623fd
commit
29237c1977
|
@ -1,3 +1,10 @@
|
|||
2006-03-03 Alan Hourihane <alanh@fairlite.demon.co.uk>
|
||||
|
||||
* winmultiwindowwndproc.c: (winTopLevelWindowProc):
|
||||
* winwndproc.c: (winWindowProc):
|
||||
https://bugs.freedesktop.org/show_bug.cgi?id=4538
|
||||
Fix mouse button release on multiwindows scrolling.
|
||||
|
||||
2006-03-03 Alan Hourihane <alanh@fairlite.demon.co.uk>
|
||||
|
||||
* winmultiwindowicons.c: (winXIconToHICON), (winUpdateIcon):
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
extern Bool g_fCursor;
|
||||
extern Bool g_fKeyboardHookLL;
|
||||
extern Bool g_fSoftwareCursor;
|
||||
extern Bool g_fButton[3];
|
||||
|
||||
|
||||
/*
|
||||
|
@ -592,33 +593,39 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
|
|||
case WM_LBUTTONDOWN:
|
||||
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
|
||||
break;
|
||||
g_fButton[0] = TRUE;
|
||||
return winMouseButtonsHandle (s_pScreen, ButtonPress, Button1, wParam);
|
||||
|
||||
case WM_LBUTTONUP:
|
||||
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
|
||||
break;
|
||||
g_fButton[0] = FALSE;
|
||||
return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button1, wParam);
|
||||
|
||||
case WM_MBUTTONDBLCLK:
|
||||
case WM_MBUTTONDOWN:
|
||||
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
|
||||
break;
|
||||
g_fButton[1] = TRUE;
|
||||
return winMouseButtonsHandle (s_pScreen, ButtonPress, Button2, wParam);
|
||||
|
||||
case WM_MBUTTONUP:
|
||||
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
|
||||
break;
|
||||
g_fButton[1] = FALSE;
|
||||
return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button2, wParam);
|
||||
|
||||
case WM_RBUTTONDBLCLK:
|
||||
case WM_RBUTTONDOWN:
|
||||
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
|
||||
break;
|
||||
g_fButton[2] = TRUE;
|
||||
return winMouseButtonsHandle (s_pScreen, ButtonPress, Button3, wParam);
|
||||
|
||||
case WM_RBUTTONUP:
|
||||
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
|
||||
break;
|
||||
g_fButton[2] = FALSE;
|
||||
return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button3, wParam);
|
||||
|
||||
case WM_XBUTTONDBLCLK:
|
||||
|
|
|
@ -53,6 +53,7 @@ extern void winFixShiftKeys (int iScanCode);
|
|||
*/
|
||||
|
||||
Bool g_fCursor = TRUE;
|
||||
Bool g_fButton[3] = { FALSE, FALSE, FALSE };
|
||||
|
||||
|
||||
/*
|
||||
|
@ -917,6 +918,8 @@ winWindowProc (HWND hwnd, UINT message,
|
|||
case WIN_POLLING_MOUSE_TIMER_ID:
|
||||
{
|
||||
POINT point;
|
||||
WPARAM wL, wM, wR, wShift, wCtrl;
|
||||
LPARAM lPos;
|
||||
|
||||
/* Get the current position of the mouse cursor */
|
||||
GetCursorPos (&point);
|
||||
|
@ -928,6 +931,21 @@ winWindowProc (HWND hwnd, UINT message,
|
|||
/* Deliver absolute cursor position to X Server */
|
||||
miPointerAbsoluteCursor (point.x, point.y,
|
||||
g_c32LastInputEventTime = GetTickCount());
|
||||
|
||||
/* Check if a button was released but we didn't see it */
|
||||
GetCursorPos (&point);
|
||||
wL = (GetKeyState (VK_LBUTTON) & 0x8000)?MK_LBUTTON:0;
|
||||
wM = (GetKeyState (VK_MBUTTON) & 0x8000)?MK_MBUTTON:0;
|
||||
wR = (GetKeyState (VK_RBUTTON) & 0x8000)?MK_RBUTTON:0;
|
||||
wShift = (GetKeyState (VK_SHIFT) & 0x8000)?MK_SHIFT:0;
|
||||
wCtrl = (GetKeyState (VK_CONTROL) & 0x8000)?MK_CONTROL:0;
|
||||
lPos = MAKELPARAM(point.x, point.y);
|
||||
if (g_fButton[0] & !wL)
|
||||
PostMessage (hwnd, WM_LBUTTONUP, wCtrl|wM|wR|wShift, lPos);
|
||||
if (g_fButton[1] & !wM)
|
||||
PostMessage (hwnd, WM_MBUTTONUP, wCtrl|wL|wR|wShift, lPos);
|
||||
if (g_fButton[2] & !wR)
|
||||
PostMessage (hwnd, WM_RBUTTONUP, wCtrl|wL|wM|wShift, lPos);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user