summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@freedesktop.org>2009-04-11 16:12:23 -0700
committerJeremy Huddleston <jeremyhu@freedesktop.org>2009-04-11 17:22:50 -0700
commit8522a759c9e78478bb399b91d3a0af2d23ea6766 (patch)
tree4a0f87a331973fb86f6c92a5c34006ba591e4bf5
parent5e55becddccc376ab7338789562ad6d6cd750de9 (diff)
XQuartz: Only set MotionNotify on activation if it is updated.
(cherry picked from commit ae8077a251ef27381a755d57ff974767bda16148)
-rw-r--r--hw/xquartz/X11Application.m6
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index f27894fdf..0a36b1d4e 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -83,6 +83,7 @@ extern int darwinFakeButtons;
* location when we become the foreground application
*/
static NSPoint bgMouseLocation;
+static BOOL bgMouseLocationUpdated = FALSE;
X11Application *X11App;
@@ -192,7 +193,8 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
size_t i;
DEBUG_LOG("state=%d, _x_active=%d, \n", state, _x_active)
if (state) {
- DarwinSendPointerEvents(darwinPointer, MotionNotify, 0, bgMouseLocation.x, bgMouseLocation.y, 0.0, 0.0, 0.0);
+ if(bgMouseLocationUpdated)
+ DarwinSendPointerEvents(darwinPointer, MotionNotify, 0, bgMouseLocation.x, bgMouseLocation.y, 0.0, 0.0, 0.0);
DarwinSendDDXEvent(kXquartzActivate, 0);
if (!_x_active) {
@@ -1087,9 +1089,11 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
#endif
{
bgMouseLocation = location;
+ bgMouseLocationUpdated = TRUE;
return;
}
} else {
+ bgMouseLocationUpdated = FALSE;
DarwinSendPointerEvents(pDev, MotionNotify, 0, location.x,
location.y, pressure, tilt.x, tilt.y);
}