summaryrefslogtreecommitdiff
path: root/src/core/window-props.c
diff options
context:
space:
mode:
authorVictor Kareh <vkareh@redhat.com>2024-04-05 14:04:58 -0400
committerVictor Kareh <vkareh@vkareh.net>2025-04-02 20:37:16 +0000
commit94ff81575062ecdd57a28eb8a3c7bfaaa6b77b03 (patch)
tree3f13be543378e64e3a43c2d83a9c4acb37619037 /src/core/window-props.c
parent79c00a9a63a3d3ebc325b1ec68e07be27156598a (diff)
downloadmarco-94ff81575062ecdd57a28eb8a3c7bfaaa6b77b03.tar.bz2
marco-94ff81575062ecdd57a28eb8a3c7bfaaa6b77b03.tar.xz
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.)
Diffstat (limited to 'src/core/window-props.c')
-rw-r--r--src/core/window-props.c25
1 files changed, 25 insertions, 0 deletions
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 },
};