From e25991f5382d260384012579e354aba03fc00ca4 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 27 Oct 2011 20:36:55 +0100 Subject: [PATCH] =?utf8?q?Bugfix:=20Don=E2=80=99t=20invoke=20resizing=20wh?= =?utf8?q?en=20clicking=20on=20the=20decoration=20in=20a=20>=201=20child?= =?utf8?q?=20split=20con=20(Thanks=20julien)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes: #534 --- src/click.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/click.c b/src/click.c index 04f5b871..8121e160 100644 --- a/src/click.c +++ b/src/click.c @@ -121,8 +121,30 @@ static bool tiling_resize(Con *con, xcb_button_press_event_t *event, click_desti DLOG("BORDER x = %d, y = %d for con %p, window 0x%08x\n", event->event_x, event->event_y, con, event->event); DLOG("checks for right >= %d\n", con->window_rect.x + con->window_rect.width); - if (dest == CLICK_DECORATION) + if (dest == CLICK_DECORATION) { + /* The user clicked on a window decoration. We ignore the following case: + * The container is a h-split, tabbed or stacked container with > 1 + * window. Decorations will end up next to each other and the user + * expects to switch to a window by clicking on its decoration. */ + + /* To make the check actually work in case of a h-split container, we + * need to find the resize con in this function (as opposed to in + * tiling_resize_for_border()). The con which was passed is the actualy + * child window, not the split container. */ + while (con->type != CT_WORKSPACE && + con->type != CT_FLOATING_CON && + con->parent->orientation != VERT) + con = con->parent; + + if ((con->layout == L_STACKED || + con->layout == L_TABBED || + con->orientation == HORIZ) && + con_num_children(con) > 1) { + DLOG("Not handling this resize, this container has > 1 child.\n"); + return false; + } return tiling_resize_for_border(con, BORDER_TOP, event); + } if (event->event_x >= 0 && event->event_x <= bsr.x && event->event_y >= bsr.y && event->event_y <= con->rect.height + bsr.height) -- 2.39.5