diff options
author | Victor Kareh <[email protected]> | 2024-04-08 12:23:57 -0400 |
---|---|---|
committer | Victor Kareh <[email protected]> | 2025-04-02 20:37:16 +0000 |
commit | 797b4dc01895b9936c68aad9f8b4e8b7b24502ab (patch) | |
tree | 2d9d6fc47152aa70a7ea35557ff5e403692b021d /src/core/window-props.c | |
parent | 34a06a853aedea845b4723989b97b1384e80869d (diff) | |
download | marco-797b4dc01895b9936c68aad9f8b4e8b7b24502ab.tar.bz2 marco-797b4dc01895b9936c68aad9f8b4e8b7b24502ab.tar.xz |
In systems with bamfdaemon running, windows get this property for
finding the dekstop spec file of an application. This can be used to
find the defined icon for any application window that reports this
attribute and provider much better icon matching.
Diffstat (limited to 'src/core/window-props.c')
-rw-r--r-- | src/core/window-props.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/core/window-props.c b/src/core/window-props.c index 83f1de3d..4383100f 100644 --- a/src/core/window-props.c +++ b/src/core/window-props.c @@ -1626,6 +1626,29 @@ reload_gtk_application_id (MetaWindow *window, } } +static void +reload_bamf_desktop_file (MetaWindow *window, + MetaPropValue *value, + gboolean initial) +{ + char *requested = NULL; + char *current = window->bamf_desktop_file; + + if (value->type != META_PROP_VALUE_INVALID) + { + requested = value->v.str; + meta_verbose ("Requested _BAMF_DESKTOP_FILE \"%s\" for window %s.\n", + requested, window->desc); + } + + if (g_strcmp0 (requested, current) != 0) + { + g_free (current); + + window->bamf_desktop_file = 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 @@ -1676,6 +1699,7 @@ meta_display_init_window_prop_hooks (MetaDisplay *display) { 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 }, + { display->atom__BAMF_DESKTOP_FILE, META_PROP_VALUE_STRING, reload_bamf_desktop_file }, { 0 }, }; |