mirror of
https://github.com/vale981/bspwm
synced 2025-03-06 02:01:42 -05:00
Protect mouse pointer when pointer_follows_focus set
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.
This commit is contained in:
parent
28e04dced1
commit
cd38445039
1 changed files with 5 additions and 2 deletions
7
events.c
7
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue