Small optimization in enter_notify

This commit is contained in:
Bastien Dejean 2012-10-24 19:31:33 +02:00
parent fa82a462c0
commit 7889c52640

View file

@ -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};
}
}