diff options
Diffstat (limited to 'src/core/window-props.c')
-rw-r--r-- | src/core/window-props.c | 64 |
1 files changed, 56 insertions, 8 deletions
diff --git a/src/core/window-props.c b/src/core/window-props.c index e1275817..4383100f 100644 --- a/src/core/window-props.c +++ b/src/core/window-props.c @@ -311,20 +311,19 @@ get_local_pid (MetaWindow *window) spec.client = window->xwindow; spec.mask = XRES_CLIENT_ID_PID_MASK; - if (!XResQueryClientIds (window->display->xdisplay, + if (XResQueryClientIds (window->display->xdisplay, 1, &spec, &num_ids, - &client_ids)) - return pid; + &client_ids) != Success) + return pid; for (i = 0; i < num_ids; i++) { - if (client_ids[i].spec.mask == XRES_CLIENT_ID_PID_MASK) - { - pid = XResGetClientPid (&client_ids[i]); - break; - } + pid = XResGetClientPid (&client_ids[i]); + + if (pid != -1) + break; } XResClientIdsDestroy (num_ids, client_ids); @@ -1603,6 +1602,53 @@ 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); + } +} + +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 @@ -1652,6 +1698,8 @@ 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 }, + { display->atom__BAMF_DESKTOP_FILE, META_PROP_VALUE_STRING, reload_bamf_desktop_file }, { 0 }, }; |