summaryrefslogtreecommitdiff
path: root/src/events.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2000-10-21 18:48:41 +0000
committersabetts <sabetts>2000-10-21 18:48:41 +0000
commit00ef34a4e0e7df8e7dabc01c04b86d8e99b724a0 (patch)
tree253b77f24e144c241b5c75991efbfc51f9a477f7 /src/events.c
parenta6978cef7990be4c59d2aec841b4d01ec8ed2eec (diff)
downloadratpoison-00ef34a4e0e7df8e7dabc01c04b86d8e99b724a0.zip
for windows that don't grab the mouse, ratpoison restores the rat to
its position before it was hidden by a keystroke when it receives a PointerMotion event.
Diffstat (limited to 'src/events.c')
-rw-r--r--src/events.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/events.c b/src/events.c
index 78c12f9..9ac37ad 100644
--- a/src/events.c
+++ b/src/events.c
@@ -304,8 +304,8 @@ key_press (XEvent *ev)
if (rat_visible)
{
- XWarpPointer (dpy, None, s->root, 0, 0, 0, 0, s->root_attr.width, s->root_attr.height);
-/* rat_visible = 0; */
+ XWarpPointer (dpy, None, s->root, 0, 0, 0, 0, s->root_attr.width - 2, s->root_attr.height - 2);
+ rat_visible = 0;
}
if (!s) return;
@@ -350,10 +350,16 @@ property_notify (XEvent *ev)
void
rat_motion (XMotionEvent *ev)
{
+ screen_info *s;
+ s = find_screen (ev->root);
+ if (!s) return;
+
+ if (ev->x_root == s->root_attr.width - 2 && ev->y_root == s->root_attr.height - 2) return;
+
if (!rat_visible)
{
- XWarpPointer (dpy, None, ev->root, 0, 0, 0, 0, rat_x, rat_y);
- /* rat_visible = 1; */
+ XWarpPointer (dpy, None, rp_current_window->w, 0, 0, 0, 0, rat_x, rat_y);
+ rat_visible = 1;
}
rat_x = ev->x_root;