wayland/client: Add make_desktop() method

Allows to mark a wayland client window as a DOCK window. The reason for
this is that in Gala (elementary OS's window manager) we would like to
continue using GTK apps as panel and dock on wayland.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3612>
This commit is contained in:
Leonhard 2024-02-23 15:58:19 +01:00 committed by Marge Bot
parent 7bf8945da4
commit d603cc351f
2 changed files with 25 additions and 0 deletions

View File

@ -64,5 +64,9 @@ META_EXPORT
void meta_wayland_client_make_desktop (MetaWaylandClient *client, void meta_wayland_client_make_desktop (MetaWaylandClient *client,
MetaWindow *window); MetaWindow *window);
META_EXPORT
void meta_wayland_client_make_dock (MetaWaylandClient *client,
MetaWindow *window);
G_END_DECLS G_END_DECLS

View File

@ -494,6 +494,27 @@ meta_wayland_client_make_desktop (MetaWaylandClient *client,
meta_window_set_type (window, META_WINDOW_DESKTOP); meta_window_set_type (window, META_WINDOW_DESKTOP);
} }
/**
* meta_wayland_client_make_dock:
* @client: a #MetaWaylandClient
* @window: a MetaWindow
*
* Mark window as DOCK window
*/
void
meta_wayland_client_make_dock (MetaWaylandClient *client,
MetaWindow *window)
{
g_return_if_fail (META_IS_WAYLAND_CLIENT (client));
g_return_if_fail (META_IS_WINDOW (window));
g_return_if_fail (window->type == META_WINDOW_NORMAL);
if (!meta_wayland_client_owns_window (client, window))
return;
meta_window_set_type (window, META_WINDOW_DOCK);
}
gboolean gboolean
meta_wayland_client_matches (MetaWaylandClient *client, meta_wayland_client_matches (MetaWaylandClient *client,
const struct wl_client *wayland_client) const struct wl_client *wayland_client)