general: make method meta_window_set_type public
Allowing code from inside mutter to create a child process and delegate on it some of its tasks is something very useful, because code inside the compositor must share the main loop with it, which means that complex tasks can produce stalls in the refresh of the desktop. Also, having to create an extension for any privileged graphical element is an stopper for a lot of programmers who already know GTK+ but doesn't know Clutter.
Under X11 there is no problem doing this, because any program has full control over their windows, but under Wayland it is a different story: a program can't neither force their window to be kept at the top (like a docker program does) or at the bottom (like a program for desktop icons does), nor hide it from the list of windows. This means that it is not possible for a "classic", non-priviledged program, to fulfill these tasks, and it can be done only from code inside mutter (like a gnome-shell extension). Also, there is no way for an extension to give that kind of "superpowers" to the window of a process created by it.
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 ...
all in a secure manner, avoiding insecure programs to do the same.
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. Thus, an extension (which is privileged code) can launch a process and give those extra permissions to the windows of that process. It also renames it to meta_window_set_window_type, to keep consistency.
It is complemented by !754 , 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.
Tested with my extension Desktop-Icons-ng under Wayland and works fine