mirror of
https://github.com/vale981/bspwm
synced 2025-03-05 18:01:37 -05:00
Small optimization in enter_notify
This commit is contained in:
parent
fa82a462c0
commit
7889c52640
1 changed files with 3 additions and 7 deletions
10
events.c
10
events.c
|
@ -274,19 +274,15 @@ void enter_notify(xcb_generic_event_t *evt)
|
|||
PRINTF("enter notify %X %d %d\n", e->event, e->mode, e->detail);
|
||||
|
||||
if (!focus_follows_mouse
|
||||
|| (e->mode != XCB_NOTIFY_MODE_NORMAL && e->detail == XCB_NOTIFY_DETAIL_INFERIOR))
|
||||
return;
|
||||
|
||||
xcb_point_t pos;
|
||||
get_pointer_position(&pos);
|
||||
if (pointer_position.x == pos.x && pointer_position.y == pos.y)
|
||||
|| (e->mode != XCB_NOTIFY_MODE_NORMAL && e->detail == XCB_NOTIFY_DETAIL_INFERIOR)
|
||||
|| (pointer_position.x == e->root_x && pointer_position.y == e->root_y))
|
||||
return;
|
||||
|
||||
window_location_t loc;
|
||||
if (locate_window(e->event, &loc)) {
|
||||
select_monitor(loc.monitor);
|
||||
focus_node(loc.monitor, loc.desktop, loc.node, true);
|
||||
pointer_position = pos;
|
||||
pointer_position = (xcb_point_t) {e->root_x, e->root_y};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue