From: Michael Stapelberg Date: Fri, 26 Nov 2010 17:18:40 +0000 (+0100) Subject: Bugfix: When handling an EnterNotify for a child window, access the correct con-... X-Git-Tag: tree-pr1~66 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e744b48b304c42303a79f181932c19d202d336d2;p=i3%2Fi3 Bugfix: When handling an EnterNotify for a child window, access the correct con->layout --- diff --git a/src/handlers.c b/src/handlers.c index f5966db9..7e65af4d 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -191,9 +191,12 @@ int handle_enter_notify(void *ignored, xcb_connection_t *conn, if (event_is_ignored(event->sequence)) return 1; + bool enter_child = false; /* Get container by frame or by child window */ - if ((con = con_by_frame_id(event->event)) == NULL) + if ((con = con_by_frame_id(event->event)) == NULL) { con = con_by_window_id(event->event); + enter_child = true; + } /* If not, then the user moved his cursor to the root window. In that case, we adjust c_ws */ if (con == NULL) { @@ -203,7 +206,7 @@ int handle_enter_notify(void *ignored, xcb_connection_t *conn, } /* see if the user entered the window on a certain window decoration */ - int layout = con->layout; + int layout = (enter_child ? con->parent->layout : con->layout); Con *child; TAILQ_FOREACH(child, &(con->nodes_head), nodes) if (rect_contains(child->deco_rect, event->event_x, event->event_y)) {