aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Dudemanguy <random342@airmail.cc>2023-08-28 10:49:24 -0500
committerLibravatar Ronan Pigott <ronan@rjp.ie>2023-08-28 17:04:53 -0700
commit3d5ae9813d390ea747462fc0026ee43b7c77d0f2 (patch)
tree3e100a27121e7f4c76a6badc90b725d067d33470
parentRevert "view: update wlr_toplevel size on client resizes" (diff)
downloadsway-3d5ae9813d390ea747462fc0026ee43b7c77d0f2.tar.gz
sway-3d5ae9813d390ea747462fc0026ee43b7c77d0f2.tar.zst
sway-3d5ae9813d390ea747462fc0026ee43b7c77d0f2.zip
xdg_shell: update wlr_toplevel size on client resizes
If a floating client resizes itself, sway updates several of its internal dimensions to match but not wlr_toplevel. This means that the next time wlroots sends a toplevel configure event, it can have wrong coordinates that resize the client back to its old size. To fix this, let's just use wlr_xdg_toplevel_set_size so the wlr_toplevel has the same dimensions as sway. Exactly the same as 0183b9d35d0ce750588e700e536b7d2e367b0d0a but the logic is onlly applied to xdg_shell and not xwayland.
-rw-r--r--sway/desktop/xdg_shell.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index 377a0f1c..c2a985ee 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -294,6 +294,8 @@ static void handle_commit(struct wl_listener *listener, void *data) {
294 memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box)); 294 memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box));
295 if (container_is_floating(view->container)) { 295 if (container_is_floating(view->container)) {
296 view_update_size(view); 296 view_update_size(view);
297 wlr_xdg_toplevel_set_size(view->wlr_xdg_toplevel, view->geometry.width,
298 view->geometry.height);
297 transaction_commit_dirty_client(); 299 transaction_commit_dirty_client();
298 } else { 300 } else {
299 view_center_surface(view); 301 view_center_surface(view);