]> git.sur5r.net Git - i3/i3/commitdiff
Implement click on stack/tab decoration to focus
authorMichael Stapelberg <michael@stapelberg.de>
Fri, 26 Nov 2010 17:57:15 +0000 (18:57 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Fri, 26 Nov 2010 17:57:15 +0000 (18:57 +0100)
src/click.c

index d33c52410c18b0894fd5b77b43f8c73c5058ab06..0304e10591159ddb793aca08c4c96e8c7da34351 100644 (file)
@@ -286,8 +286,18 @@ int handle_button_press(void *ignored, xcb_connection_t *conn, xcb_button_press_
             return 1;
         }
 
-        if (con->layout == L_STACKED) {
-            DLOG("stacked!\n");
+        if (con->layout == L_STACKED || con->layout == L_TABBED) {
+            DLOG("stacked! click is on %d, %d\n", event->event_x, event->event_y);
+            Con *child;
+            TAILQ_FOREACH(child, &(con->nodes_head), nodes) {
+                if (!rect_contains(child->deco_rect, event->event_x, event->event_y))
+                    continue;
+
+                con_focus(child);
+                break;
+            }
+            tree_render();
+            return 1;
         }
 
 #if 0