]> git.lizzy.rs Git - bspwm.git/commitdiff
Protect mouse pointer when pointer_follows_focus set
authorArtur Shaik <ashaihullin@gmail.com>
Thu, 27 Nov 2014 08:08:43 +0000 (14:08 +0600)
committerArtur Shaik <ashaihullin@gmail.com>
Thu, 27 Nov 2014 08:08:43 +0000 (14:08 +0600)
When dialog window shows, I cannot move pointer outside this dialog window
because when I move it, it jumps in window's center (again on dialog).
So, this commit disables pff when mouse focus event happen and enables
after.

events.c

index 055b30d2bef66eb06f16fff712deb1d55c7cacc1..1e8c8292a5da29d9285b55e36ce6e55af79c8848 100644 (file)
--- a/events.c
+++ b/events.c
@@ -347,15 +347,18 @@ void motion_notify(xcb_generic_event_t *evt)
        xcb_point_t pt = {e->root_x, e->root_y};
        query_pointer(&win, NULL);
 
-       bool backup = pointer_follows_monitor;
+       bool pfm_backup = pointer_follows_monitor;
+       bool pff_backup = pointer_follows_focus;
        auto_raise = false;
        pointer_follows_monitor = false;
+       pointer_follows_focus = false;
        if (!window_focus(win)) {
                monitor_t *m = monitor_from_point(pt);
                if (m != NULL && m != mon)
                        focus_node(m, m->desk, m->desk->focus);
        }
-       pointer_follows_monitor = backup;
+       pointer_follows_monitor = pfm_backup;
+       pointer_follows_focus = pff_backup;
        auto_raise = true;
 }