XQuartz: Send MotionNotify before button presses when X11 is in the background
(cherry picked from commit c80d0ec18ef5b842447d31360406d0b5b9424222)
This commit is contained in:
parent
5ccfad8df0
commit
e86f4e9302
|
@ -1054,8 +1054,7 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
|
||||||
* NSTabletProximityEventSubtype will come from NSTabletPoint
|
* NSTabletProximityEventSubtype will come from NSTabletPoint
|
||||||
* rather than NSMouseMoved.
|
* rather than NSMouseMoved.
|
||||||
pressure = [e pressure];
|
pressure = [e pressure];
|
||||||
tilt_x = [e tilt].x;
|
tilt = [e tilt];
|
||||||
tilt_y = [e tilt].y;
|
|
||||||
pDev = darwinTabletCurrent;
|
pDev = darwinTabletCurrent;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1071,6 +1070,7 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!quartzServerVisible && noTestExtensions) {
|
if(!quartzServerVisible && noTestExtensions) {
|
||||||
|
if(ev_button == 0) {
|
||||||
#if 0
|
#if 0
|
||||||
/* Seems this has somehow triggered 100% CPU usage while X11.app is in the
|
/* Seems this has somehow triggered 100% CPU usage while X11.app is in the
|
||||||
* background on some obscure HW configurations.
|
* background on some obscure HW configurations.
|
||||||
|
@ -1078,7 +1078,7 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
|
||||||
*/
|
*/
|
||||||
//#if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION > 0
|
//#if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION > 0
|
||||||
/* Older libXplugin (Tiger/"Stock" Leopard) aren't thread safe, so we can't call xp_find_window from the Appkit thread */
|
/* Older libXplugin (Tiger/"Stock" Leopard) aren't thread safe, so we can't call xp_find_window from the Appkit thread */
|
||||||
xp_window_id wid;
|
xp_window_id wid = 0;
|
||||||
xp_error e;
|
xp_error e;
|
||||||
|
|
||||||
/* Sigh. Need to check that we're really over one of
|
/* Sigh. Need to check that we're really over one of
|
||||||
|
@ -1087,17 +1087,18 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
|
||||||
* when another window is over us or we might show a tooltip)
|
* when another window is over us or we might show a tooltip)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
wid = 0;
|
|
||||||
e = xp_find_window(location.x, location.y, 0, &wid);
|
e = xp_find_window(location.x, location.y, 0, &wid);
|
||||||
|
|
||||||
if (e == XP_Success && wid == 0) {
|
if (e == XP_Success && wid == 0)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
bgMouseLocation = location;
|
bgMouseLocation = location;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#else
|
} else {
|
||||||
bgMouseLocation = location;
|
DarwinSendPointerEvents(pDev, MotionNotify, 0, location.x,
|
||||||
return;
|
location.y, pressure, tilt.x, tilt.y);
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DarwinSendPointerEvents(pDev, ev_type, ev_button, location.x, location.y,
|
DarwinSendPointerEvents(pDev, ev_type, ev_button, location.x, location.y,
|
||||||
|
@ -1125,6 +1126,16 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NSScrollWheel:
|
case NSScrollWheel:
|
||||||
|
//#if !defined(XPLUGIN_VERSION) || XPLUGIN_VERSION == 0
|
||||||
|
#if 1 /* Strange 100% CPU issue, so always enabling. see above */
|
||||||
|
/* If we're in the background, we need to send a MotionNotify event
|
||||||
|
* first, since we aren't getting them on background mouse motion
|
||||||
|
*/
|
||||||
|
if(!quartzServerVisible && noTestExtensions) {
|
||||||
|
DarwinSendPointerEvents(darwinPointer, MotionNotify, 0, location.x,
|
||||||
|
location.y, pressure, tilt.x, tilt.y);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
DarwinSendScrollEvents([e deltaX], [e deltaY], location.x, location.y,
|
DarwinSendScrollEvents([e deltaX], [e deltaY], location.x, location.y,
|
||||||
pressure, tilt.x, tilt.y);
|
pressure, tilt.x, tilt.y);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue