mirror of
https://github.com/vale981/bspwm
synced 2025-03-06 02:01:42 -05:00
Grab the pointer in order to capture motions
This commit is contained in:
parent
36decdad62
commit
dfc03b5e26
1 changed files with 3 additions and 6 deletions
9
events.c
9
events.c
|
@ -327,8 +327,7 @@ void enter_notify(xcb_generic_event_t *evt)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t values[] = {CLIENT_EVENT_MASK|FFP_MASK|XCB_EVENT_MASK_POINTER_MOTION};
|
xcb_grab_pointer(dpy, 1, win, XCB_EVENT_MASK_POINTER_MOTION, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC, XCB_NONE, XCB_NONE, XCB_CURRENT_TIME);
|
||||||
xcb_change_window_attributes(dpy, win, XCB_CW_EVENT_MASK, values);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void leave_notify(xcb_generic_event_t *evt)
|
void leave_notify(xcb_generic_event_t *evt)
|
||||||
|
@ -342,8 +341,7 @@ void leave_notify(xcb_generic_event_t *evt)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t values[] = {CLIENT_EVENT_MASK|FFP_MASK};
|
xcb_ungrab_pointer(dpy, XCB_CURRENT_TIME);
|
||||||
xcb_change_window_attributes(dpy, win, XCB_CW_EVENT_MASK, values);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void motion_notify(xcb_generic_event_t *evt)
|
void motion_notify(xcb_generic_event_t *evt)
|
||||||
|
@ -375,8 +373,7 @@ void motion_notify(xcb_generic_event_t *evt)
|
||||||
if (locate_window(win, &loc)) {
|
if (locate_window(win, &loc)) {
|
||||||
if (loc.node != mon->desk->focus) {
|
if (loc.node != mon->desk->focus) {
|
||||||
focus_node(loc.monitor, loc.desktop, loc.node);
|
focus_node(loc.monitor, loc.desktop, loc.node);
|
||||||
uint32_t values[] = {CLIENT_EVENT_MASK|FFP_MASK};
|
xcb_ungrab_pointer(dpy, XCB_CURRENT_TIME);
|
||||||
xcb_change_window_attributes(dpy, win, XCB_CW_EVENT_MASK, values);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
xcb_point_t pt = {e->root_x, e->root_y};
|
xcb_point_t pt = {e->root_x, e->root_y};
|
||||||
|
|
Loading…
Add table
Reference in a new issue