diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2019-02-15 09:31:04 +0100 |
---|---|---|
committer | Olivier Fourdan <ofourdan@redhat.com> | 2019-02-15 09:40:44 +0100 |
commit | 6fe46cac60c95e17dd5cd8c7b11aecfe1da5a18c (patch) | |
tree | f72d5bbde457682af2b6a4f538ffa018662115c7 | |
parent | c3b9ef7bf5fcafb386d1ff2b88dcd1c605190ed9 (diff) | |
download | mutter-6fe46cac60c95e17dd5cd8c7b11aecfe1da5a18c.tar.gz |
wayland/xdg-shell: Do not maximize if not possible
On X11, if a window cannot be maximized because its minimum size is
already larger than the output size, a request to maximize will be
ignored.
On Wayland, however, we would still honor the maximize request and
switch the window state to maximized, without actually moving the window
which leads to weird visual effects, as the window end up being
maximized in-place.
To avoid this, make sure the window has the maximize functionality
available prior to change its state in xdg-shell `set_maximized`
request.
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/463
-rw-r--r-- | src/wayland/meta-wayland-legacy-xdg-shell.c | 3 | ||||
-rw-r--r-- | src/wayland/meta-wayland-xdg-shell.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/wayland/meta-wayland-legacy-xdg-shell.c b/src/wayland/meta-wayland-legacy-xdg-shell.c index 504b34ffd..1523481d4 100644 --- a/src/wayland/meta-wayland-legacy-xdg-shell.c +++ b/src/wayland/meta-wayland-legacy-xdg-shell.c @@ -397,6 +397,9 @@ zxdg_toplevel_v6_set_maximized (struct wl_client *client, if (!window) return; + if (!window->has_maximize_func) + return; + meta_window_force_placement (window, TRUE); meta_window_maximize (window, META_MAXIMIZE_BOTH); } diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c index c7e738357..afd4bb94b 100644 --- a/src/wayland/meta-wayland-xdg-shell.c +++ b/src/wayland/meta-wayland-xdg-shell.c @@ -393,6 +393,9 @@ xdg_toplevel_set_maximized (struct wl_client *client, if (!window) return; + if (!window->has_maximize_func) + return; + meta_window_force_placement (window, TRUE); meta_window_maximize (window, META_MAXIMIZE_BOTH); } |