path: root/video/out
diff options
authorPhilip Langdale <>2019-11-26 08:39:40 +0800
committerPhilip Langdale <>2019-11-29 16:56:20 +0800
commitf3c2f1f6aa969001a74455061637cc7e194f614a (patch)
treedc7f2b2509084f210aa028abf4f197235e506629 /video/out
parent5e3eb03ecfc604652705d56c778c08ccead9e64e (diff)
wayland: restore window geometry after un-maximize
At least with gnome-shell (I know, I know), the compositor does not provide the old window size when leaving the maximized state. Instead, we get a toplevel_config event with a 0x0 size and no additional states. Today, we already save the window geometry to restore it when leaving the fullscreen state, so we just need a small change for it to kick in for leaving the maximized state. If I read this correctly, we'll still respect the size passed by a compositor that actually provides the old size.
Diffstat (limited to 'video/out')
1 files changed, 2 insertions, 3 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index 990a3c500f..dee87e617e 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -979,9 +979,8 @@ static void handle_toplevel_config(void *data, struct xdg_toplevel *toplevel,
vo_query_and_reset_events(wl->vo, VO_EVENT_LIVE_RESIZING);
if (width > 0 && height > 0) {
- if (!wl->fullscreen) {
- if (wl->vo->opts->keepaspect && wl->vo->opts->keepaspect_window &&
- !wl->maximized) {
+ if (!wl->fullscreen && !wl->maximized) {
+ if (wl->vo->opts->keepaspect && wl->vo->opts->keepaspect_window) {
if (width > height)
width = height * wl->aspect_ratio;