The commit f2f4af0d50ba9f2d36cf225162a30928f55d7bd6 missed one situation where mutter does things differently, i.e. changes what surface actor is associated with a given window actor: reparenting a Xwayland window when changing whether it is decorated. To summarize, there are three types of window actors: X11 window actors - directly tied to the backing X11 window. The corresponding surface actor is directly owned by the window actor and will never change. Wayland window actors - gets its surface actor from MetaWaylandSurface at construction. A single MetaWaylandSurface may create and destroy multiple window actors over time, but a single window actor will never change surface actor. Xwayland window actors - a mix between the above two types; the window corresponds to the X11 window, and so does the window actor, but the surface itself comes from the MetaWaylandSurface. Normally when a X11 window is unmapped, the corresponding MetaWindow is unmanaged. With Xwayland, this happens indirectly via the destruction of the wl_surface. The exception to this is windows that are reparented during changing their decoration state - in this case on plain X11, the MetaWindow stays alive. With Xwayland however, there is a race condition; since the MetaWindow is tied to the wl_surface, if we receive the new surface ID atom before the destruction of the old wl_surface, we'll try to associate the existing MetaWindow and MetaWindowActor with the new wl_surface, hitting the assert. If the surface destruction arrives first, the MetaWindow and MetaWindowActor will be disposed, and the we wouldn't hit the assert. To handle this race gracefully, reinstate handling of replacing the surface actor of an existing window actor, to handle this race, as it was handled before. Eventually, it should be reconsidered whether the MetaWindow lifetime is tied to the wl_surface or if it should be changed to be consistent with plain X11, as this re-exposes another bug where the X11 client and mutter will enter a feedback loop where the window is repeatedly remapped. See https://gitlab.freedesktop.org/xorg/xserver/issues/740. Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/709 https://gitlab.gnome.org/GNOME/mutter/merge_requests/773
Mutter
Mutter is a Wayland display server and X11 window manager and compositor library.
When used as a Wayland display server, it runs on top of KMS and libinput. It implements the compositor side of the Wayland core protocol as well as various protocol extensions. It also has functionality related to running X11 applications using Xwayland.
When used on top of Xorg it acts as a X11 window manager and compositing manager.
It contains functionality related to, among other things, window management, window compositing, focus tracking, workspace management, keybindings and monitor configuration.
Internally it uses a fork of Cogl, a hardware acceleration abstraction library used to simplify usage of OpenGL pipelines, as well as a fork af Clutter, a scene graph and user interface toolkit.
Mutter is used by, for example, GNOME Shell, the GNOME core user interface, and by Gala, elementary OS's window manager. It can also be run standalone, using the command "mutter", but just running plain mutter is only intended for debugging purposes.
Contributing
To contribute, open merge requests at https://gitlab.gnome.org/GNOME/mutter.
The coding style used is primarily the GNU flavor of the GNOME coding
style
with some minor additions such as preferring stdint.h
types over GLib
fundamental types, and a soft 80 character line limit. However, in general,
look at the file you're editing for inspiration.
Commit messages should follow the GNOME commit message guidelines. We require an URL to either an issue or a merge request in each commit.
License
Mutter is distributed under the terms of the GNU General Public License, version 2 or later. See the COPYING file for detalis.