From f4aa6118e9af1ce0e2a6b84ed61d7c1fd9531c89 Mon Sep 17 00:00:00 2001 From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Thu, 30 Jun 2022 20:02:24 +0200 Subject: [PATCH] src/layers.c: Adjust views based on usable_area changes --- include/labwc.h | 1 + src/desktop.c | 10 ++++++++++ src/layers.c | 4 +++- src/output.c | 5 +---- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/include/labwc.h b/include/labwc.h index 416fb03c..be6a629d 100644 --- a/include/labwc.h +++ b/include/labwc.h @@ -460,6 +460,7 @@ void foreign_toplevel_handle_create(struct view *view); void desktop_move_to_front(struct view *view); void desktop_move_to_back(struct view *view); void desktop_focus_and_activate_view(struct seat *seat, struct view *view); +void desktop_arrange_all_views(struct server *server); enum lab_cycle_dir { LAB_CYCLE_DIR_NONE, diff --git a/src/desktop.c b/src/desktop.c index b19cd4be..5a3ad8bc 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -99,6 +99,16 @@ deactivate_all_views(struct server *server) } } +void +desktop_arrange_all_views(struct server *server) +{ + /* Adjust window positions/sizes */ + struct view *view; + wl_list_for_each(view, &server->views, link) { + view_adjust_for_layout_change(view); + } +} + void desktop_focus_and_activate_view(struct seat *seat, struct view *view) { diff --git a/src/layers.c b/src/layers.c index 8a03d3cb..47c0d021 100644 --- a/src/layers.c +++ b/src/layers.c @@ -98,7 +98,9 @@ layers_arrange(struct output *output) !seat->focused_layer->current.keyboard_interactive) { seat_set_focus_layer(seat, NULL); } - /* FIXME: should we call a desktop_arrange_all_views() here? */ + + /* Finally re-arrange all views based on usable_area */ + desktop_arrange_all_views(server); } static void diff --git a/src/output.c b/src/output.c index d2634cf7..688640f3 100644 --- a/src/output.c +++ b/src/output.c @@ -209,10 +209,7 @@ static void output_update_for_layout_change(struct server *server) { /* Adjust window positions/sizes */ - struct view *view; - wl_list_for_each(view, &server->views, link) { - view_adjust_for_layout_change(view); - } + desktop_arrange_all_views(server); /* * "Move" each wlr_output_cursor (in per-output coordinates) to -- 2.52.0