mirror of
https://github.com/labwc/labwc.git
synced 2025-11-01 22:58:47 -04:00
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:
parent
45ce978b5a
commit
8c411acf1a
1 changed files with 18 additions and 18 deletions
36
src/view.c
36
src/view.c
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue