src/view.c: move up view_apply_natural_geometry()

So its visible by all the other view_apply_xxx_geometry() functions.
This commit is contained in:
Consolatis 2023-01-02 16:25:34 +01:00
parent 45ce978b5a
commit 8c411acf1a

View file

@ -354,6 +354,24 @@ view_center(struct view *view)
}
}
static void
view_apply_natural_geometry(struct view *view)
{
struct wlr_output_layout *layout = view->server->output_layout;
if (wlr_output_layout_intersects(layout, NULL,
&view->natural_geometry)) {
/* restore to original geometry */
view_move_resize(view, view->natural_geometry);
} else {
/* reposition if original geometry is offscreen */
struct wlr_box box = view->natural_geometry;
if (view_compute_centered_position(view, box.width, box.height,
&box.x, &box.y)) {
view_move_resize(view, box);
}
}
}
static void
view_apply_tiled_geometry(struct view *view, struct output *output)
{
@ -437,24 +455,6 @@ view_apply_special_geometry(struct view *view)
return true;
}
static void
view_apply_natural_geometry(struct view *view)
{
struct wlr_output_layout *layout = view->server->output_layout;
if (wlr_output_layout_intersects(layout, NULL,
&view->natural_geometry)) {
/* restore to original geometry */
view_move_resize(view, view->natural_geometry);
} else {
/* reposition if original geometry is offscreen */
struct wlr_box box = view->natural_geometry;
if (view_compute_centered_position(view, box.width, box.height,
&box.x, &box.y)) {
view_move_resize(view, box);
}
}
}
static void
set_maximized(struct view *view, bool maximized)
{