From: Michael Stapelberg Date: Fri, 26 Nov 2010 17:57:15 +0000 (+0100) Subject: Implement click on stack/tab decoration to focus X-Git-Tag: tree-pr1~63 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=db3002fce0474eaa4a769248428d8aec929b64c9;p=i3%2Fi3 Implement click on stack/tab decoration to focus --- 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