From 94ff81575062ecdd57a28eb8a3c7bfaaa6b77b03 Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Fri, 5 Apr 2024 14:04:58 -0400 Subject: window: Parse _GTK_APPLICATION_ID property GTK+ has support for the application ID property. This will allow Marco to reconstruct the path to the desktop spec file and so have access to all internal attributes (e.g. name, icon, etc.) --- src/core/window-props.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/core/window-props.c') diff --git a/src/core/window-props.c b/src/core/window-props.c index d106152d..83f1de3d 100644 --- a/src/core/window-props.c +++ b/src/core/window-props.c @@ -1602,6 +1602,30 @@ reload_gtk_theme_variant (MetaWindow *window, meta_ui_update_frame_style (window->screen->ui, window->frame->xwindow); } } + +static void +reload_gtk_application_id (MetaWindow *window, + MetaPropValue *value, + gboolean initial) +{ + char *requested = NULL; + char *current = window->gtk_application_id; + + if (value->type != META_PROP_VALUE_INVALID) + { + requested = value->v.str; + meta_verbose ("Requested \"%s\" gtk-application-id for window %s.\n", + requested, window->desc); + } + + if (g_strcmp0 (requested, current) != 0) + { + g_free (current); + + window->gtk_application_id = g_strdup (requested); + } +} + /** * Initialises the property hooks system. Each row in the table named "hooks" * represents an action to take when a property is found on a newly-created @@ -1651,6 +1675,7 @@ meta_display_init_window_prop_hooks (MetaDisplay *display) { display->atom__NET_WM_USER_TIME_WINDOW, META_PROP_VALUE_WINDOW, reload_net_wm_user_time_window }, { display->atom__GTK_THEME_VARIANT, META_PROP_VALUE_UTF8, reload_gtk_theme_variant, }, { display->atom__GTK_FRAME_EXTENTS, META_PROP_VALUE_CARDINAL_LIST, reload_gtk_frame_extents }, + { display->atom__GTK_APPLICATION_ID, META_PROP_VALUE_UTF8, reload_gtk_application_id }, { 0 }, }; -- cgit v1.2.1