From cef5778097a96891cb8b70c45e973c0c84d36669 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 10 Sep 2009 21:05:29 +0200 Subject: [PATCH] Bugfix: Fix clicking on stack windows in tabbed mode (Thanks Atsutane) --- src/handlers.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/handlers.c b/src/handlers.c index f8e79bc9..4b8d890a 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -300,9 +300,16 @@ static bool button_press_stackwin(xcb_connection_t *conn, xcb_button_press_event i3Font *font = load_font(conn, config.font); int decoration_height = (font->height + 2 + 2); int destination = (event->event_y / decoration_height), - c = 0; + c = 0, + num_clients = 0; Client *client; + CIRCLEQ_FOREACH(client, &(stack_win->container->clients), clients) + num_clients++; + + if (stack_win->container->mode == MODE_TABBED) + destination = (event->event_x / (stack_win->container->width / num_clients)); + LOG("Click on stack_win for client %d\n", destination); CIRCLEQ_FOREACH(client, &(stack_win->container->clients), clients) if (c++ == destination) {