]> git.sur5r.net Git - i3/i3/commitdiff
Fix click to focus.
authorFernando Tarlá Cardoso Lemos <fernandotcl@gmail.com>
Mon, 29 Nov 2010 02:11:30 +0000 (00:11 -0200)
committerMichael Stapelberg <michael@stapelberg.de>
Mon, 29 Nov 2010 21:09:05 +0000 (22:09 +0100)
src/click.c
src/handlers.c

index 69319005421831e9be6f8716b8f8fed668aafe73..5b7f08271165ddc8ea07db05cc7d3e10212e826e 100644 (file)
@@ -286,30 +286,18 @@ int handle_button_press(void *ignored, xcb_connection_t *conn, xcb_button_press_
             return 1;
         }
 
-        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
-        if (!floating_mod_on_tiled_client(conn, client, event)) {
-#endif
-            xcb_allow_events(conn, XCB_ALLOW_REPLAY_POINTER, event->time);
-            xcb_flush(conn);
-#if 0
+        DLOG("border click on non-floating container at %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;
         }
-#endif
 
-        //return 1;
+        tree_render();
+        return 1;
     }
 
     /* click to focus */
index 78522ea0a58b2c3a2e1391d46b3f5a45c5e9dc03..d8e859b174d8a1aa6cb91c35662c1bf5dd035295 100644 (file)
@@ -263,6 +263,9 @@ int handle_motion_notify(void *ignored, xcb_connection_t *conn, xcb_motion_notif
         return 1;
     }
 
+    if (config.disable_focus_follows_mouse)
+        return 1;
+
     if (con->layout != L_DEFAULT)
         return 1;