From f3c2f1f6aa969001a74455061637cc7e194f614a Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Tue, 26 Nov 2019 08:39:40 +0800 Subject: 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. --- video/out/wayland_common.c | 5 ++--- 1 file 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; else -- cgit v1.2.3