[Wayland-bugs] [Bug 783901] Restoring maximized window state in Wayland results in tiny window

mutter (GNOME Bugzilla) bugzilla at gnome.org
Fri Jun 23 08:20:09 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=783901

--- Comment #26 from Olivier Fourdan <ofourdan at redhat.com> ---
Humm, is there such a thing as a "cleverly computer saved rect"?

>From what I can see, it's just a saved rect, i.e. the size before maximization
(as saved in meta_window_maximize()).

In meta_window_unmaximize(), the saved rect is restored, it can be shrunk to be
less than 80% of the workarea though.

But the point is, the saved rect is not cleverly computed anywhere. Besides,
it's difficult to compute the position right without having the size being set,
and the problem is precisely that when we get to xdg_toplevel_set_maximized()
the window size is not known and the placement is not done yet.

Prior to commit 561d71b, that wasn't a problem because the window not being
placed yet would have trigger the fallback code path in meta_window_maximize()
to simply set "maximize_*_after_placement" and return, without actually saving
neither the size nor position.

https://git.gnome.org/browse/mutter/tree/src/core/window.c#n2729

With commit 561d71b, we make sure the window is (forcibly) placed in
xdg_toplevel_set_maximized(), meaning that the placement is done based on the
wrong (unknown) size, and the size is also saved in meta_window_maximize() as
window->placed is not set, thus avoiding the fallback path as before.

So, the real appropriate fix would be to fix bug 782183 and bug 781353 without
forcing the placement.

IMHO the real issue with bug 782183 and bug 781353 is that we show the window
too "early", ie meta_window_show() gets called from idle_calc_showing()
*before* the window is actually placed and maximized, leading to the ugly
wrongly placed animation.

I would rather fix this properly rather than adding even more "fixes" to
placement as this may cause some other subtile breackage elsewhere...

I just fail to understand why we end up calling meta_window_show() from
idle_calc_showing() in this particular case...

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-bugs/attachments/20170623/370836e5/attachment.html>


More information about the wayland-bugs mailing list