From 76472e1ba8efd04b0eab765c88e97ac5e0c9c51a Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Sat, 15 Jul 2023 23:17:39 -0500 Subject: [PATCH] wayland: remove old sway/wlroots hack It's actually been like this for years, but wlroots doesn't keep track of resizes a client does independent of the compositor. When using sway, this leads to weird behavior with floating clients resizing themselves back to the old size if you unfocus it. mpv has been working around this for a long time, but it's really annoying to selectively ignore events based on a weird heuristic. Since Sway finally fixed this bug, let's go ahead and drop this crap. Note that other wlroots compositors may possibly experience a regression if they didn't correct for this like sway does, but it's for their own good. --- video/out/wayland_common.c | 9 --------- video/out/wayland_common.h | 2 -- 2 files changed, 11 deletions(-) diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index a36076b70806c..e6b38f868b5bc 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -1040,11 +1040,6 @@ static void handle_toplevel_config(void *data, struct xdg_toplevel *toplevel, width = height = 0; } - int old_toplevel_width = wl->toplevel_width; - int old_toplevel_height = wl->toplevel_height; - wl->toplevel_width = width; - wl->toplevel_height = height; - if (!wl->configured) { /* Save initial window size if the compositor gives us a hint here. */ bool autofit_or_geometry = vo_opts->geometry.wh_valid || vo_opts->autofit.wh_valid || @@ -1144,10 +1139,6 @@ static void handle_toplevel_config(void *data, struct xdg_toplevel *toplevel, goto resize; } - if (old_toplevel_width == wl->toplevel_width && - old_toplevel_height == wl->toplevel_height) - return; - if (!wl->locked_size) { if (vo_opts->keepaspect) { double scale_factor = (double)width / wl->reduced_width; diff --git a/video/out/wayland_common.h b/video/out/wayland_common.h index 1d5b2a21d276e..0f796371839fd 100644 --- a/video/out/wayland_common.h +++ b/video/out/wayland_common.h @@ -64,8 +64,6 @@ struct vo_wayland_state { int bounded_width; int reduced_height; int reduced_width; - int toplevel_width; - int toplevel_height; /* State */ bool activated;