summaryrefslogtreecommitdiff
path: root/plugins/mouse/msd-locate-pointer.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mouse/msd-locate-pointer.c')
-rw-r--r--plugins/mouse/msd-locate-pointer.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/plugins/mouse/msd-locate-pointer.c b/plugins/mouse/msd-locate-pointer.c
index 468d840..c6ba14a 100644
--- a/plugins/mouse/msd-locate-pointer.c
+++ b/plugins/mouse/msd-locate-pointer.c
@@ -646,9 +646,23 @@ filter (GdkXEvent *xevent,
XAllowEvents (xev->xkey.display,
SyncKeyboard,
xev->xkey.time);
+ XGrabButton (xev->xkey.display,
+ AnyButton,
+ AnyModifier,
+ xev->xkey.window,
+ False,
+ ButtonPressMask,
+ GrabModeSync,
+ GrabModeAsync,
+ None,
+ None);
}
else
{
+ XUngrabButton (xev->xkey.display,
+ AnyButton,
+ AnyModifier,
+ xev->xkey.window);
XAllowEvents (xev->xkey.display,
AsyncKeyboard,
xev->xkey.time);
@@ -660,10 +674,26 @@ filter (GdkXEvent *xevent,
XAllowEvents (xev->xkey.display,
ReplayKeyboard,
xev->xkey.time);
- XUngrabKeyboard (GDK_DISPLAY_XDISPLAY (display),
+ XUngrabButton (xev->xkey.display,
+ AnyButton,
+ AnyModifier,
+ xev->xkey.window);
+ XUngrabKeyboard (xev->xkey.display,
xev->xkey.time);
}
}
+ else if (xev->type == ButtonPress)
+ {
+ XAllowEvents (xev->xbutton.display,
+ ReplayPointer,
+ xev->xbutton.time);
+ XUngrabButton (xev->xbutton.display,
+ AnyButton,
+ AnyModifier,
+ xev->xbutton.window);
+ XUngrabKeyboard (xev->xbutton.display,
+ xev->xbutton.time);
+ }
return GDK_FILTER_CONTINUE;
}