[mutter] wayland: place window if maximized before placement

commit 561d71b8aee7a76a13ca009db4dc1f247e06617c
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Wed May 10 11:32:29 2017 +0200

    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
    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.

 src/wayland/meta-wayland-xdg-shell.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c
index 88e0cae..99fc9ac 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);

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]