aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kenny Levinsen <kl@kl.wtf>2020-06-03 14:51:29 +0200
committerLibravatar Simon Ser <contact@emersion.fr>2020-06-03 16:41:17 +0200
commitf8dd7df1f510cdd2e53b25d2bb9a1edc19235e04 (patch)
tree1cd29d59d94383587f85d168fc0fda270dab209b
parentcontainer: Remove useless surface dimensions (diff)
downloadsway-f8dd7df1f510cdd2e53b25d2bb9a1edc19235e04.tar.gz
sway-f8dd7df1f510cdd2e53b25d2bb9a1edc19235e04.tar.zst
sway-f8dd7df1f510cdd2e53b25d2bb9a1edc19235e04.zip
shells: Resize on commit if geometry x/y changes
Client-side decorations lead to changes to y position, so make sure we catch that.
-rw-r--r--sway/desktop/xdg_shell.c4
-rw-r--r--sway/desktop/xwayland.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index 7775f660..2bf026f7 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -284,7 +284,9 @@ static void handle_commit(struct wl_listener *listener, void *data) {
284 wlr_xdg_surface_get_geometry(xdg_surface, &new_geo); 284 wlr_xdg_surface_get_geometry(xdg_surface, &new_geo);
285 285
286 if ((new_geo.width != view->geometry.width || 286 if ((new_geo.width != view->geometry.width ||
287 new_geo.height != view->geometry.height)) { 287 new_geo.height != view->geometry.height ||
288 new_geo.x != view->geometry.x ||
289 new_geo.y != view->geometry.y)) {
288 // The view has unexpectedly sent a new size 290 // The view has unexpectedly sent a new size
289 desktop_damage_view(view); 291 desktop_damage_view(view);
290 view_update_size(view, new_geo.width, new_geo.height); 292 view_update_size(view, new_geo.width, new_geo.height);
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index b51bbb74..743e85bc 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -373,7 +373,9 @@ static void handle_commit(struct wl_listener *listener, void *data) {
373 get_geometry(view, &new_geo); 373 get_geometry(view, &new_geo);
374 374
375 if ((new_geo.width != view->geometry.width || 375 if ((new_geo.width != view->geometry.width ||
376 new_geo.height != view->geometry.height)) { 376 new_geo.height != view->geometry.height ||
377 new_geo.x != view->geometry.x ||
378 new_geo.y != view->geometry.y)) {
377 // The view has unexpectedly sent a new size 379 // The view has unexpectedly sent a new size
378 // eg. The Firefox "Save As" dialog when downloading a file 380 // eg. The Firefox "Save As" dialog when downloading a file
379 desktop_damage_view(view); 381 desktop_damage_view(view);