This patch makes public the method
set_type from the
Meta.Window class, allowing to set the window type from inside a gnome-shell extension. It also renames that method from
meta_window_set_window_type, to keep consistency with the corresponding method
meta_window_get_window_type (which is already public).
With this, an extension (which is privileged code) can launch a child process and set the
window_type property, which is used by Gnome Shell and several extensions to determine if a window must have certain properties, like not being visible in the window list. Under X11 it is not needed, because the application itself can do it, but under Wayland there isn't another way. It is complemented by !754 (merged) , which allows to securely detect when a window belongs to an specific process launched from an extension, thus ensuring that only that process receives the privilege.
It is important to note that since c843102e, mutter ignores this property in Wayland, so these extensions must do by themselves things like setting the window Z position. This still can be done with the current public API (but, of course, only from privileged code, like a Gnome Shell extension).
Several examples of the usefulness of this are that, with it, it is possible to write programs that implements:
- desktop icons
- a dock
- a top or bottom bar ...
Also, moving the logic from inside mutter to an external program has more advantages: first, the new code doesn't run in the same main loop than mutter, which means that it can't block the compositor if it it blocks for too much time; also, it allows to use classic GTK instead of ST/Clutter, thus allowing more people to contribute.
Tested with my extension Desktop-Icons-ng under Wayland and works fine
Fixes #733 (closed)