[gnome-panel] libpanel-applet: return process type and applet uid



commit 12dd7cacaab112ec0d2f8f53205feaa84e3c67b8
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Thu Nov 6 19:44:36 2014 +0200

    libpanel-applet: return process type and applet uid
    
    Return applet process type and generated uid from factory. Process
    type will be needed to know if we should create GtkSocket, but uid
    will be used to get applet widget.

 .../panel-applet-container.c                       |   11 +++++++++--
 libpanel-applet/panel-applet-factory.c             |   12 ++++++++++--
 2 files changed, 19 insertions(+), 4 deletions(-)
---
diff --git a/gnome-panel/libpanel-applet-private/panel-applet-container.c 
b/gnome-panel/libpanel-applet-private/panel-applet-container.c
index 8705a04..595bad0 100644
--- a/gnome-panel/libpanel-applet-private/panel-applet-container.c
+++ b/gnome-panel/libpanel-applet-private/panel-applet-container.c
@@ -29,7 +29,9 @@ struct _PanelAppletContainerPrivate {
        guint       name_watcher_id;
        gchar      *bus_name;
 
+       gboolean    out_of_process;
        guint32     xid;
+       guint32     uid;
        GtkWidget  *socket;
 
        GHashTable *pending_ops;
@@ -369,7 +371,12 @@ get_applet_cb (GObject      *source_object,
        }
 
        container = PANEL_APPLET_CONTAINER (g_async_result_get_source_object (G_ASYNC_RESULT (result)));
-       g_variant_get (retvals, "(&ou)", &applet_path, &container->priv->xid);
+       g_variant_get (retvals,
+                      "(&obuu)",
+                      &applet_path,
+                      &container->priv->out_of_process,
+                      &container->priv->xid,
+                      &container->priv->uid);
 
        g_dbus_proxy_new (connection,
                          G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
@@ -422,7 +429,7 @@ on_factory_appeared (GDBusConnection   *connection,
                                PANEL_APPLET_FACTORY_INTERFACE,
                                "GetApplet",
                                data->parameters,
-                               G_VARIANT_TYPE ("(ou)"),
+                               G_VARIANT_TYPE ("(obuu)"),
                                G_DBUS_CALL_FLAGS_NONE,
                                -1,
                                data->cancellable,
diff --git a/libpanel-applet/panel-applet-factory.c b/libpanel-applet/panel-applet-factory.c
index 7139261..e7e18b4 100644
--- a/libpanel-applet/panel-applet-factory.c
+++ b/libpanel-applet/panel-applet-factory.c
@@ -189,6 +189,7 @@ panel_applet_factory_get_applet (PanelAppletFactory    *factory,
        const gchar *applet_id;
        gint         screen_num;
        GVariant    *props;
+       GVariant    *return_value;
        GdkScreen   *screen;
        guint32      xid;
        guint32      uid;
@@ -219,8 +220,13 @@ panel_applet_factory_get_applet (PanelAppletFactory    *factory,
        g_hash_table_insert (factory->applets, GUINT_TO_POINTER (uid), applet);
        g_object_set_data (applet, "uid", GUINT_TO_POINTER (uid));
 
-       g_dbus_method_invocation_return_value (invocation,
-                                              g_variant_new ("(ou)", object_path, xid));
+       return_value = g_variant_new ("(obuu)",
+                                     object_path,
+                                     factory->out_of_process,
+                                     xid,
+                                     uid);
+
+       g_dbus_method_invocation_return_value (invocation, return_value);
 }
 
 static void
@@ -248,7 +254,9 @@ static const gchar introspection_xml[] =
                "<arg name='screen' type='i' direction='in'/>"
                "<arg name='props' type='a{sv}' direction='in'/>"
                "<arg name='applet' type='o' direction='out'/>"
+               "<arg name='out-of-process' type='b' direction='out'/>"
                "<arg name='xid' type='u' direction='out'/>"
+               "<arg name='uid' type='u' direction='out'/>"
              "</method>"
            "</interface>"
          "</node>";


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