From 371ec037b82b86df341fd4420e64e0a8368316ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fernando=20Tarl=C3=A1=20Cardoso=20Lemos?= Date: Mon, 29 Nov 2010 00:11:30 -0200 Subject: [PATCH] Fix click to focus. --- src/click.c | 32 ++++++++++---------------------- src/handlers.c | 3 +++ 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/src/click.c b/src/click.c index 69319005..5b7f0827 100644 --- a/src/click.c +++ b/src/click.c @@ -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 */ diff --git a/src/handlers.c b/src/handlers.c index 78522ea0..d8e859b1 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -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; -- 2.39.5