From 561d71b8aee7a76a13ca009db4dc1f247e06617c Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 10 May 2017 11:32:29 +0200 Subject: [PATCH] wayland: place window if maximized before placement If a client changes the state of a surface to issue a set_maximize, this causes apply_pending_state() to be called before mutter has placed the window. If the monitor on which the window is to be shown initially is different from the one where the pointer is placed, this causes the effect to be played at the wrong location before the window eventually reaches its location on another monitor. Force the window to be placed prior to change its state to maximized in xdg-shell so that mutter won't relocate the window afterwards. This also avoids sending an xdg_toplevel.configure with a size of 0x0 which would cause the client to initially draw its surface with some arbitrary size. https://bugzilla.gnome.org/show_bug.cgi?id=782183 https://bugzilla.gnome.org/show_bug.cgi?id=781353 --- src/wayland/meta-wayland-xdg-shell.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c index 88e0cae28..99fc9acff 100644 --- a/src/wayland/meta-wayland-xdg-shell.c +++ b/src/wayland/meta-wayland-xdg-shell.c @@ -348,6 +348,7 @@ xdg_toplevel_set_maximized (struct wl_client *client, { MetaWaylandSurface *surface = surface_from_xdg_toplevel_resource (resource); + meta_window_force_placement (surface->window); meta_window_maximize (surface->window, META_MAXIMIZE_BOTH); }