summaryrefslogtreecommitdiffstats
path: root/video/out/wayland_common.h
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2020-02-05 20:47:10 -0600
committerDudemanguy <random342@airmail.cc>2020-02-06 16:17:25 +0000
commit2aaf5317200da0b836b1772576a0d8654e5313a7 (patch)
tree7967afaa6279a12ed584843ba28f060c8672477f /video/out/wayland_common.h
parent7c5c05771796468f96c97e03a692b0dbeb484e02 (diff)
downloadmpv-2aaf5317200da0b836b1772576a0d8654e5313a7.tar.bz2
mpv-2aaf5317200da0b836b1772576a0d8654e5313a7.tar.xz
wayland: toplevel config fixes
There were a couple of erroneous things in the handle_toplevel_config function. Firstly, looping through the different states was not handled correctly. Launching a window as maximized (can happen in sway for example) was always stuck on true and would never be set to false. Fix this by always checking if XDG_TOPLEVEL_STATE_MAXIMIZED is found or not. Also do a similar thing for the fullscreen state. Additionally, there were some issues with resizing windows and window-scale going back to old sizes. The root of this problem is that the width and height arguments of handle_toplevel_config aren't actually guarenteed to be the actual width and height of the surface. There are times when mpv will set the surface size on its own (like with window-scale) which will be unknown to the toplevel listener. To complicate matters, there are times when we do want to use the width and height arguments (like when resizing with the mouse). Fix this by checking if the width and height arguments reported by handle_toplevel_config changed from the previous call of the function. If the value is different, then we go ahead and use them when setting mpv's geometry. If not, then we just ignore it.
Diffstat (limited to 'video/out/wayland_common.h')
-rw-r--r--video/out/wayland_common.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/video/out/wayland_common.h b/video/out/wayland_common.h
index ad965ef1d3..86ead415f9 100644
--- a/video/out/wayland_common.h
+++ b/video/out/wayland_common.h
@@ -83,6 +83,8 @@ struct vo_wayland_state {
int mouse_unscaled_y;
int scaling;
int touch_entries;
+ int toplevel_width;
+ int toplevel_height;
uint32_t pointer_id;
int display_fd;
struct wl_callback *frame_callback;