Cygwin/X: enqueue a pointer motion event on mouse movement
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
This commit is contained in:
parent
816e0d243d
commit
35d7602830
|
@ -1005,6 +1005,9 @@ winMouseButtonsHandle (ScreenPtr pScreen,
|
||||||
int iEventType, int iButton,
|
int iEventType, int iButton,
|
||||||
WPARAM wParam);
|
WPARAM wParam);
|
||||||
|
|
||||||
|
void
|
||||||
|
winEnqueueMotion(int x, int y);
|
||||||
|
|
||||||
#ifdef XWIN_NATIVEGDI
|
#ifdef XWIN_NATIVEGDI
|
||||||
/*
|
/*
|
||||||
* winnativegdi.c
|
* winnativegdi.c
|
||||||
|
|
|
@ -344,3 +344,29 @@ winMouseButtonsHandle (ScreenPtr pScreen,
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enqueue a motion event.
|
||||||
|
*
|
||||||
|
* XXX: miPointerMove does exactly this, but is static :-( (and uses a static buffer)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void winEnqueueMotion(int x, int y)
|
||||||
|
{
|
||||||
|
miPointerSetPosition(g_pwinPointer, &x, &y);
|
||||||
|
g_c32LastInputEventTime = GetTickCount();
|
||||||
|
|
||||||
|
int i, nevents;
|
||||||
|
int valuators[2];
|
||||||
|
|
||||||
|
EventListPtr events;
|
||||||
|
GetEventList(&events);
|
||||||
|
|
||||||
|
valuators[0] = x;
|
||||||
|
valuators[1] = y;
|
||||||
|
nevents = GetPointerEvents(events, g_pwinPointer, MotionNotify, 0,
|
||||||
|
POINTER_ABSOLUTE, 0, 2, valuators);
|
||||||
|
|
||||||
|
for (i = 0; i < nevents; i++)
|
||||||
|
mieqEnqueue(g_pwinPointer, events[i].event);
|
||||||
|
}
|
||||||
|
|
|
@ -535,9 +535,9 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Deliver absolute cursor position to X Server */
|
/* Deliver absolute cursor position to X Server */
|
||||||
miPointerAbsoluteCursor (ptMouse.x - s_pScreenInfo->dwXOffset,
|
winEnqueueMotion(ptMouse.x - s_pScreenInfo->dwXOffset,
|
||||||
ptMouse.y - s_pScreenInfo->dwYOffset,
|
ptMouse.y - s_pScreenInfo->dwYOffset);
|
||||||
g_c32LastInputEventTime = GetTickCount ());
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case WM_NCMOUSEMOVE:
|
case WM_NCMOUSEMOVE:
|
||||||
|
|
|
@ -571,9 +571,9 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Deliver absolute cursor position to X Server */
|
/* Deliver absolute cursor position to X Server */
|
||||||
miPointerAbsoluteCursor (ptMouse.x - pScreenInfo->dwXOffset,
|
winEnqueueMotion(ptMouse.x - pScreenInfo->dwXOffset,
|
||||||
ptMouse.y - pScreenInfo->dwYOffset,
|
ptMouse.y - pScreenInfo->dwYOffset);
|
||||||
g_c32LastInputEventTime = GetTickCount ());
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case WM_NCMOUSEMOVE:
|
case WM_NCMOUSEMOVE:
|
||||||
|
|
|
@ -764,9 +764,8 @@ winWindowProc (HWND hwnd, UINT message,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Deliver absolute cursor position to X Server */
|
/* Deliver absolute cursor position to X Server */
|
||||||
miPointerAbsoluteCursor (GET_X_LPARAM(lParam)-s_pScreenInfo->dwXOffset,
|
winEnqueueMotion(GET_X_LPARAM(lParam)-s_pScreenInfo->dwXOffset,
|
||||||
GET_Y_LPARAM(lParam)-s_pScreenInfo->dwYOffset,
|
GET_Y_LPARAM(lParam)-s_pScreenInfo->dwYOffset);
|
||||||
g_c32LastInputEventTime = GetTickCount ());
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case WM_NCMOUSEMOVE:
|
case WM_NCMOUSEMOVE:
|
||||||
|
@ -929,8 +928,7 @@ winWindowProc (HWND hwnd, UINT message,
|
||||||
point.y -= GetSystemMetrics (SM_YVIRTUALSCREEN);
|
point.y -= GetSystemMetrics (SM_YVIRTUALSCREEN);
|
||||||
|
|
||||||
/* Deliver absolute cursor position to X Server */
|
/* Deliver absolute cursor position to X Server */
|
||||||
miPointerAbsoluteCursor (point.x, point.y,
|
winEnqueueMotion(point.x , point.y);
|
||||||
g_c32LastInputEventTime = GetTickCount());
|
|
||||||
|
|
||||||
/* Check if a button was released but we didn't see it */
|
/* Check if a button was released but we didn't see it */
|
||||||
GetCursorPos (&point);
|
GetCursorPos (&point);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user