From 1dc661af176d80db8b283e9c38fd127f71d33052 Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Tue, 23 Jan 2024 10:10:42 -0500 Subject: [PATCH] layer_shell: Arrange popups even if exclusive zone doesn't change --- include/sway/desktop/transaction.h | 3 +++ sway/desktop/layer_shell.c | 2 ++ sway/desktop/transaction.c | 6 +++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/sway/desktop/transaction.h b/include/sway/desktop/transaction.h index 17d41fa35..dd7edb7a5 100644 --- a/include/sway/desktop/transaction.h +++ b/include/sway/desktop/transaction.h @@ -2,6 +2,7 @@ #define _SWAY_TRANSACTION_H #include #include +#include /** * Transactions enable us to perform atomic layout updates. @@ -58,4 +59,6 @@ bool transaction_notify_view_ready_by_serial(struct sway_view *view, bool transaction_notify_view_ready_by_geometry(struct sway_view *view, double x, double y, int width, int height); +void arrange_popups(struct wlr_scene_tree *popups); + #endif diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index c71abce7f..9a35ef95a 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c @@ -85,6 +85,8 @@ void arrange_layers(struct sway_output *output) { sway_log(SWAY_DEBUG, "Usable area changed, rearranging output"); output->usable_area = usable_area; arrange_output(output); + } else { + arrange_popups(root->layers.popup); } } diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index acc3e3f9c..c1a988cac 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c @@ -606,9 +606,9 @@ static void arrange_output(struct sway_output *output, int width, int height) { } } -static void arrange_popup(struct wlr_scene_tree *popup) { +void arrange_popups(struct wlr_scene_tree *popups) { struct wlr_scene_node *node; - wl_list_for_each(node, &popup->children, link) { + wl_list_for_each(node, &popups->children, link) { struct sway_xdg_popup *popup = scene_descriptor_try_get(node, SWAY_SCENE_DESC_POPUP); @@ -679,7 +679,7 @@ static void arrange_root(struct sway_root *root) { } } - arrange_popup(root->layers.popup); + arrange_popups(root->layers.popup); } /**