src/layers.c: Adjust views based on usable_area changes

This commit is contained in:
Consolatis 2022-06-30 20:02:24 +02:00 committed by Johan Malm
parent 09915b8f43
commit f4aa6118e9
4 changed files with 15 additions and 5 deletions

View file

@ -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,

View file

@ -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)
{

View file

@ -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

View file

@ -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