From db3002fce0474eaa4a769248428d8aec929b64c9 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 26 Nov 2010 18:57:15 +0100 Subject: [PATCH] Implement click on stack/tab decoration to focus --- src/click.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/click.c b/src/click.c index d33c5241..0304e105 100644 --- a/src/click.c +++ b/src/click.c @@ -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 -- 2.39.5