action: implicitely unmaximize when unsnapping

Co-authored-by: tokyo4j <hrak1529@gmail.com>
This commit is contained in:
Jens Peters 2024-09-24 06:39:21 +02:00 committed by Hiroaki Yamamoto
parent 694c5a7469
commit b9414d8b8d
2 changed files with 5 additions and 4 deletions

View file

@ -109,8 +109,8 @@ Actions are used in menus and keyboard/mouse bindings.
See labwc-config(5) for further information on how to define regions.
*<action name="UnSnap" />*
Resize and move active window back to its untiled position if
it had been tiled to a direction or region.
Resize and move the active window back to its untiled or unmaximized
position if it had been maximized or tiled to a direction or region.
*<action name="NextWindow" />*++
*<action name="PreviousWindow" />*

View file

@ -1172,8 +1172,9 @@ actions_run(struct view *activator, struct server *server,
}
break;
case ACTION_TYPE_UNSNAP:
if (view && view->maximized == VIEW_AXIS_NONE && !view->fullscreen
&& view_is_tiled(view)) {
if (view && !view->fullscreen && !view_is_floating(view)) {
view_maximize(view, VIEW_AXIS_NONE,
/* store_natural_geometry */ false);
view_set_untiled(view);
view_apply_natural_geometry(view);
}