From e744b48b304c42303a79f181932c19d202d336d2 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 26 Nov 2010 18:18:40 +0100 Subject: [PATCH] Bugfix: When handling an EnterNotify for a child window, access the correct con->layout --- src/handlers.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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)) { -- 2.39.5