]> git.sur5r.net Git - i3/i3/blobdiff - src/click.c
Merge pull request #3697 from orestisf1993/ewmh
[i3/i3] / src / click.c
index 5b529a383a6b00eb3ccc5d83b1005c96bf9ffd8a..58ebbf3d851053330dafe1bab389f36d93d518e5 100644 (file)
@@ -44,12 +44,9 @@ 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);
+    bool res = resize_find_tiling_participants(&first, &second, search_direction, false);
     if (!res) {
         LOG("No second container in this direction found.\n");
         return 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);
@@ -260,7 +254,7 @@ static int route_click(Con *con, xcb_button_press_event_t *event, const bool mod
 
     /* 3: For floating containers, we also want to raise them on click.
      * We will skip handling events on floating cons in fullscreen mode */
-    Con *fs = (ws ? con_get_fullscreen_con(ws, CF_OUTPUT) : NULL);
+    Con *fs = con_get_fullscreen_covering_ws(ws);
     if (floatingcon != NULL && fs != con) {
         /* 4: floating_modifier plus left mouse button drags */
         if (mod_pressed && event->detail == XCB_BUTTON_CLICK_LEFT) {
@@ -308,12 +302,6 @@ static int route_click(Con *con, xcb_button_press_event_t *event, const bool mod
         goto done;
     }
 
-    if (in_stacked) {
-        /* for stacked/tabbed cons, the resizing applies to the parent
-         * container */
-        con = con->parent;
-    }
-
     /* 7: floating modifier pressed, initiate a resize */
     if (dest == CLICK_INSIDE && mod_pressed && event->detail == XCB_BUTTON_CLICK_RIGHT) {
         if (floating_mod_on_tiled_client(con, event))