]> git.mdlowis.com Git - proto/labwc.git/commitdiff
src/view.c: move up view_apply_natural_geometry()
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Mon, 2 Jan 2023 15:25:34 +0000 (16:25 +0100)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Mon, 2 Jan 2023 15:42:07 +0000 (16:42 +0100)
So its visible by all the other view_apply_xxx_geometry() functions.

src/view.c

index 8e7ce04c0e273c284d86bfdf1bc77411bbf04128..61f7904f019d7c47689b328738549f5e563923b2 100644 (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)
 {