[gtk+] gtkapplication-dbus: use application id instead of prgname for SM



commit 046a4a6e0fbb57096f05b537248095c9c32c6744
Author: Ray Strode <rstrode redhat com>
Date:   Fri Mar 4 11:10:18 2016 -0500

    gtkapplication-dbus: use application id instead of prgname for SM
    
    gnome-session takes an "app id" for client and inhibitor registration,
    This app id is supposed to be a desktop file id (complete with the
    .desktop extension), but gtk+ currently uses g_get_prgname ().
    
    This commit changes gtkapplication to use the application id instead,
    which is a much more natural fit.  gnome-session is going to be updated
    to stop using the .desktop extension, too, so everything is consistent.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763106

 gtk/gtkapplication-dbus.c   |   10 +++-------
 gtk/gtkapplicationprivate.h |    1 -
 2 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkapplication-dbus.c b/gtk/gtkapplication-dbus.c
index 2367002..1119093 100644
--- a/gtk/gtkapplication-dbus.c
+++ b/gtk/gtkapplication-dbus.c
@@ -153,17 +153,14 @@ gtk_application_impl_dbus_startup (GtkApplicationImpl *impl,
       goto out;
     }
 
-  /* FIXME: should we reuse the D-Bus application id here ? */
-  dbus->app_id = g_strdup (g_get_prgname ());
-
   if (!register_session)
     goto out;
 
-  g_debug ("Registering client '%s' '%s'", dbus->app_id, client_id);
+  g_debug ("Registering client '%s' '%s'", dbus->application_id, client_id);
 
   res = g_dbus_proxy_call_sync (dbus->sm_proxy,
                                 "RegisterClient",
-                                g_variant_new ("(ss)", dbus->app_id, client_id),
+                                g_variant_new ("(ss)", dbus->application_id, client_id),
                                 G_DBUS_CALL_FLAGS_NONE,
                                 G_MAXINT,
                                 NULL,
@@ -391,7 +388,7 @@ gtk_application_impl_dbus_inhibit (GtkApplicationImpl         *impl,
   res = g_dbus_proxy_call_sync (dbus->sm_proxy,
                                 "Inhibit",
                                 g_variant_new ("(s usu)",
-                                               dbus->app_id,
+                                               dbus->application_id,
                                                window ? gtk_application_impl_dbus_get_window_system_id 
(dbus, window) : g_variant_new_uint32 (0),
                                                reason,
                                                flags),
@@ -517,7 +514,6 @@ gtk_application_impl_dbus_finalize (GObject *object)
 
   g_free (dbus->app_menu_path);
   g_free (dbus->menubar_path);
-  g_free (dbus->app_id);
 
   G_OBJECT_CLASS (gtk_application_impl_dbus_parent_class)->finalize (object);
 }
diff --git a/gtk/gtkapplicationprivate.h b/gtk/gtkapplicationprivate.h
index dbd7115..35819f8 100644
--- a/gtk/gtkapplicationprivate.h
+++ b/gtk/gtkapplicationprivate.h
@@ -133,7 +133,6 @@ typedef struct
   guint            menubar_id;
 
   /* Session management... */
-  gchar           *app_id; /* actually prgname... */
   GDBusProxy      *sm_proxy;
   GDBusProxy      *client_proxy;
   gchar           *client_path;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]