]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: When entering a stack window with the mouse, set the focus to the active...
authorMichael Stapelberg <michael+x200@stapelberg.de>
Thu, 26 Mar 2009 22:00:26 +0000 (23:00 +0100)
committerMichael Stapelberg <michael+x200@stapelberg.de>
Thu, 26 Mar 2009 22:00:26 +0000 (23:00 +0100)
Fixes ticket #17

src/handlers.c
src/util.c

index 6ce736ccb32c881b315245a3d35f5a3931c8f18b..c06f4853f2a6b5ed558191e42d5ea26dbf6ae216 100644 (file)
@@ -154,6 +154,17 @@ int handle_enter_notify(void *ignored, xcb_connection_t *conn, xcb_enter_notify_
         if (client == NULL)
                 client = table_get(byChild, event->event);
 
+        /* Check for stack windows */
+        if (client == NULL) {
+                struct Stack_Window *stack_win;
+                SLIST_FOREACH(stack_win, &stack_wins, stack_windows)
+                        if (stack_win->window == event->event) {
+                                client = stack_win->container->currently_focused;
+                                break;
+                        }
+        }
+
+
         /* If not, then the user moved his cursor to the root window. In that case, we adjust c_ws */
         if (client == NULL) {
                 LOG("Getting screen at %d x %d\n", event->root_x, event->root_y);
index e8440b67d65a6dc50756b9c4a7069b55173168dc..23bdc70c14f23fe0c0a2e508d086cdf9dcb3bb6f 100644 (file)
@@ -298,7 +298,8 @@ void switch_layout_mode(xcb_connection_t *conn, Container *container, int mode)
 
                 /* We want to know when… */
                 mask |= XCB_CW_EVENT_MASK;
-                values[1] =     XCB_EVENT_MASK_BUTTON_PRESS |   /* …mouse is pressed */
+                values[1] =     XCB_EVENT_MASK_ENTER_WINDOW |   /* …mouse is moved into our window */
+                                XCB_EVENT_MASK_BUTTON_PRESS |   /* …mouse is pressed */
                                 XCB_EVENT_MASK_EXPOSURE;        /* …our window needs to be redrawn */
 
                 struct Stack_Window *stack_win = &(container->stack_win);