]> git.mdlowis.com Git - proto/labwc.git/commitdiff
interactive: un-maximize only axes that are being resized
authorJohn Lindgren <john@jlindgren.net>
Mon, 1 Sep 2025 16:07:52 +0000 (12:07 -0400)
committerJohan Malm <johanmalm@users.noreply.github.com>
Mon, 1 Sep 2025 19:44:09 +0000 (20:44 +0100)
When resizing in only one axis (horizontal/vertical), there's no reason
to un-maximize the other axis.

Supporting logic was landed in the previous commit and in ebd39dfe0d1d
(which fixed the client-initiated resize case), so all that remains is
to make a small change in interactive_begin().

src/interactive.c

index adc06b8c1cf8daa02c01523586a71a045a27ab05..061fe07a7fcdc1690c4090864aca36d73089abf6 100644 (file)
@@ -119,10 +119,17 @@ interactive_begin(struct view *view, enum input_mode mode, enum lab_edge edges)
 
                /*
                 * If tiled or maximized in only one direction, reset
-                * maximized/tiled state but keep the same geometry as
-                * the starting point for the resize.
+                * tiled state and un-maximize the relevant axes, but
+                * keep the same geometry as the starting point.
                 */
-               view_set_maximized(view, VIEW_AXIS_NONE);
+               enum view_axis maximized = view->maximized;
+               if (edges & LAB_EDGES_LEFT_RIGHT) {
+                       maximized &= ~VIEW_AXIS_HORIZONTAL;
+               }
+               if (edges & LAB_EDGES_TOP_BOTTOM) {
+                       maximized &= ~VIEW_AXIS_VERTICAL;
+               }
+               view_set_maximized(view, maximized);
                view_set_untiled(view);
                cursor_shape = cursor_get_from_edge(edges);
                break;