X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fclick.c;h=81e95dfabfcf5c4f2a6a490b6dfcf919ddb7a699;hb=b87bc70cd6184f3fd066587df960a628a34e17fd;hp=b036c5f8033c29e84b2d91b475b57daff8d64572;hpb=eda440d6ae84307c6e9327c24bd4946526592a80;p=i3%2Fi3 diff --git a/src/click.c b/src/click.c index b036c5f8..81e95dfa 100644 --- a/src/click.c +++ b/src/click.c @@ -44,9 +44,6 @@ static bool tiling_resize_for_border(Con *con, border_t border, xcb_button_press case BORDER_BOTTOM: search_direction = D_DOWN; break; - default: - assert(false); - break; } bool res = resize_find_tiling_participants(&first, &second, search_direction, false); @@ -233,15 +230,12 @@ static int route_click(Con *con, xcb_button_press_event_t *event, const bool mod event->detail == XCB_BUTTON_SCROLL_LEFT || event->detail == XCB_BUTTON_SCROLL_RIGHT)) { DLOG("Scrolling on a window decoration\n"); - orientation_t orientation = (con->parent->layout == L_STACKED ? VERT : HORIZ); - /* Focus the currently focused container on the same level that the - * user scrolled on. e.g. the tabbed decoration contains - * "urxvt | i3: V[xterm geeqie] | firefox", - * focus is on the xterm, but the user scrolled on urxvt. - * The splitv container will be focused. */ + orientation_t orientation = con_orientation(con->parent); + /* Use the focused child of the tabbed / stacked container, not the + * container the user scrolled on. */ Con *focused = con->parent; focused = TAILQ_FIRST(&(focused->focus_head)); - con_activate(focused); + con_activate(con_descend_focused(focused)); /* To prevent scrolling from going outside the container (see ticket * #557), we first check if scrolling is possible at all. */ bool scroll_prev_possible = (TAILQ_PREV(focused, nodes_head, nodes) != NULL);