diff options
author | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2009-04-06 21:34:14 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2009-04-10 00:46:35 -0700 |
commit | e86f4e93020d56385418850a9eebae8076dcb9ac (patch) | |
tree | 653c42bf4898bd49f08f0bee40efea36a06f57ad /hw/xquartz/X11Application.m | |
parent | 5ccfad8df099e8ebc4bf2dd53c3db1460903b135 (diff) |
XQuartz: Send MotionNotify before button presses when X11 is in the background
(cherry picked from commit c80d0ec18ef5b842447d31360406d0b5b9424222)
Diffstat (limited to 'hw/xquartz/X11Application.m')
-rw-r--r-- | hw/xquartz/X11Application.m | 49 |
1 files changed, 30 insertions, 19 deletions
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index 937517c6e..441748101 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -1054,8 +1054,7 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe * NSTabletProximityEventSubtype will come from NSTabletPoint * rather than NSMouseMoved. pressure = [e pressure]; - tilt_x = [e tilt].x; - tilt_y = [e tilt].y; + tilt = [e tilt]; pDev = darwinTabletCurrent; */ @@ -1071,6 +1070,7 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe } if(!quartzServerVisible && noTestExtensions) { + if(ev_button == 0) { #if 0 /* Seems this has somehow triggered 100% CPU usage while X11.app is in the * background on some obscure HW configurations. @@ -1078,28 +1078,29 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe */ //#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 */ - xp_window_id wid; - xp_error e; + xp_window_id wid = 0; + xp_error e; - /* Sigh. Need to check that we're really over one of - * our windows. (We need to receive pointer events while - * not in the foreground, but we don't want to receive them - * when another window is over us or we might show a tooltip) - */ + /* Sigh. Need to check that we're really over one of + * our windows. (We need to receive pointer events while + * not in the foreground, but we don't want to receive them + * 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) { - bgMouseLocation = location; - return; - } -#else - bgMouseLocation = location; - return; + if (e == XP_Success && wid == 0) #endif + { + bgMouseLocation = location; + return; + } + } else { + DarwinSendPointerEvents(pDev, MotionNotify, 0, location.x, + location.y, pressure, tilt.x, tilt.y); + } } - + DarwinSendPointerEvents(pDev, ev_type, ev_button, location.x, location.y, pressure, tilt.x, tilt.y); @@ -1125,6 +1126,16 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe break; 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, pressure, tilt.x, tilt.y); break; |