From d603cc351fdbab23ef972926d484c46f57f07e10 Mon Sep 17 00:00:00 2001 From: Leonhard Date: Fri, 23 Feb 2024 15:58:19 +0100 Subject: [PATCH] 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: --- src/meta/meta-wayland-client.h | 4 ++++ src/wayland/meta-wayland-client.c | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/meta/meta-wayland-client.h b/src/meta/meta-wayland-client.h index c5f0c8376..67fe8d0f6 100644 --- a/src/meta/meta-wayland-client.h +++ b/src/meta/meta-wayland-client.h @@ -64,5 +64,9 @@ META_EXPORT void meta_wayland_client_make_desktop (MetaWaylandClient *client, MetaWindow *window); +META_EXPORT +void meta_wayland_client_make_dock (MetaWaylandClient *client, + MetaWindow *window); + G_END_DECLS diff --git a/src/wayland/meta-wayland-client.c b/src/wayland/meta-wayland-client.c index ecb3b0ebe..1bc5544e1 100644 --- a/src/wayland/meta-wayland-client.c +++ b/src/wayland/meta-wayland-client.c @@ -494,6 +494,27 @@ meta_wayland_client_make_desktop (MetaWaylandClient *client, 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 meta_wayland_client_matches (MetaWaylandClient *client, const struct wl_client *wayland_client)