view: expose view_set_maximized() instead of view_restore_to()

view_restore_to() (which is just set_maximized() + view_move_resize())
hasn't aged well and doesn't line up with typical usage anymore:

 - it's missing view_set_untiled(), which has to be called separately
 - it always forces view_move_resize() even when that's not needed
 - it doesn't allow un-maximizing only one axis (see next commit)
 - the fullscreen check is unnecessary (already checked in callers)

Eliminate it and just expose view_set_maximized() instead.

No functional change intended in this commit.
This commit is contained in:
John Lindgren 2025-09-01 11:49:24 -04:00 committed by Johan Malm
parent 72a5df16ea
commit 6d2140c4b7
4 changed files with 20 additions and 27 deletions

View file

@ -122,8 +122,8 @@ interactive_begin(struct view *view, enum input_mode mode, enum lab_edge edges)
* maximized/tiled state but keep the same geometry as
* the starting point for the resize.
*/
view_set_maximized(view, VIEW_AXIS_NONE);
view_set_untiled(view);
view_restore_to(view, view->pending);
cursor_shape = cursor_get_from_edge(edges);
break;
default:
@ -153,8 +153,9 @@ interactive_begin(struct view *view, enum input_mode mode, enum lab_edge edges)
interactive_anchor_to_cursor(server, &natural_geo);
/* Shaded clients will not process resize events until unshaded */
view_set_shade(view, false);
view_set_maximized(view, VIEW_AXIS_NONE);
view_set_untiled(view);
view_restore_to(view, natural_geo);
view_move_resize(view, natural_geo);
}
if (rc.resize_indicator) {