aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Aleksei Bavshin <alebastr89@gmail.com>2021-12-22 22:25:27 -0800
committerLibravatar Simon Ser <contact@emersion.fr>2022-01-16 19:26:57 +0100
commit1a5db66366f04fe545d697d20d7657a9be8c44d9 (patch)
treeac36265d68e34ce040cabd1d06a5c688e0f9fe67
parentPrint deprecation notice when running SUID (diff)
downloadsway-1a5db66366f04fe545d697d20d7657a9be8c44d9.tar.gz
sway-1a5db66366f04fe545d697d20d7657a9be8c44d9.tar.zst
sway-1a5db66366f04fe545d697d20d7657a9be8c44d9.zip
xdg-shell: use toplevel geometry to adjust the popup box
`popup_unconstrain` uses view coordinates to init the output box for popups. However wlroots expects the box to be set in a toplevel surface coordinate system, which is not always equal to view. The difference between those is a window geometry set via xdg-shell. GTK4 reserves some space for client-side decoration and thus has a window with top left corner not matching to (0, 0) of a surface. The box calculated without taking that into account was slightly shifted compared to the actual output and allowed to position part of the popup off screen. (cherry picked from commit aa443629b58e1d3d10cf64e689b661c076808d66)
-rw-r--r--sway/desktop/xdg_shell.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index c1e5bc68..5fae8296 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -72,8 +72,8 @@ static void popup_unconstrain(struct sway_xdg_popup *popup) {
72 // the output box expressed in the coordinate system of the toplevel parent 72 // the output box expressed in the coordinate system of the toplevel parent
73 // of the popup 73 // of the popup
74 struct wlr_box output_toplevel_sx_box = { 74 struct wlr_box output_toplevel_sx_box = {
75 .x = output->lx - view->container->pending.content_x, 75 .x = output->lx - view->container->pending.content_x + view->geometry.x,
76 .y = output->ly - view->container->pending.content_y, 76 .y = output->ly - view->container->pending.content_y + view->geometry.y,
77 .width = output->width, 77 .width = output->width,
78 .height = output->height, 78 .height = output->height,
79 }; 79 };