summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2021-09-13 13:45:17 -0500
committerDudemanguy <random342@airmail.cc>2021-09-13 20:49:07 +0000
commit560e6c8709811038dfcd3ff8b789670a18649d17 (patch)
tree6d1a8be8c7991edd7afdd95c5244f04ec59905e4
parent62b2c5db982103f84d61e4abb0cc3a3aff077e1c (diff)
downloadmpv-560e6c8709811038dfcd3ff8b789670a18649d17.tar.bz2
mpv-560e6c8709811038dfcd3ff8b789670a18649d17.tar.xz
wayland: report correct window size when maximized
In wayland_common, wl->window_size keeps track of the window's size when it is not in the fullscreen or maximized state. GET_UNFS_WINDOW_SIZE is meant to report the size except for when it is fullscreen (hence UNFS). However, the actual function was merely returning the wl->window_size so it was wrong for maximized windows. Workaround this by returning wl->geometry instead when we have the maximized case. Fixes #9207.
-rw-r--r--video/out/wayland_common.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index b6df672a5a..0352b8199a 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -1602,8 +1602,13 @@ int vo_wayland_control(struct vo *vo, int *events, int request, void *arg)
}
case VOCTRL_GET_UNFS_WINDOW_SIZE: {
int *s = arg;
- s[0] = mp_rect_w(wl->window_size) * wl->scaling;
- s[1] = mp_rect_h(wl->window_size) * wl->scaling;
+ if (wl->vo_opts->window_maximized) {
+ s[0] = mp_rect_w(wl->geometry) * wl->scaling;
+ s[1] = mp_rect_h(wl->geometry) * wl->scaling;
+ } else {
+ s[0] = mp_rect_w(wl->window_size) * wl->scaling;
+ s[1] = mp_rect_h(wl->window_size) * wl->scaling;
+ }
return VO_TRUE;
}
case VOCTRL_SET_UNFS_WINDOW_SIZE: {