summaryrefslogtreecommitdiff
path: root/mate-panel
diff options
context:
space:
mode:
Diffstat (limited to 'mate-panel')
-rw-r--r--mate-panel/libmate-panel-applet-private/panel-applet-container.c39
1 files changed, 32 insertions, 7 deletions
diff --git a/mate-panel/libmate-panel-applet-private/panel-applet-container.c b/mate-panel/libmate-panel-applet-private/panel-applet-container.c
index 4b4ffd2b..f1ed62f2 100644
--- a/mate-panel/libmate-panel-applet-private/panel-applet-container.c
+++ b/mate-panel/libmate-panel-applet-private/panel-applet-container.c
@@ -23,6 +23,7 @@
#include <string.h>
#include <gtk/gtk.h>
#include <gtk/gtkx.h>
+#include <panel-applets-manager.h>
#include "panel-applet-container.h"
#include "panel-marshal.h"
@@ -32,6 +33,7 @@ struct _MatePanelAppletContainerPrivate {
guint name_watcher_id;
gchar *bus_name;
+ gchar *iid;
gboolean out_of_process;
guint32 xid;
guint32 uid;
@@ -88,20 +90,35 @@ static void mate_panel_applet_container_init(MatePanelAppletContainer* container
{
container->priv = MATE_PANEL_APPLET_CONTAINER_GET_PRIVATE (container);
- container->priv->socket = gtk_socket_new ();
- g_signal_connect_swapped (container->priv->socket, "plug-removed", G_CALLBACK (mate_panel_applet_container_plug_removed), container);
-
container->priv->pending_ops = g_hash_table_new_full (g_direct_hash,
g_direct_equal,
NULL,
(GDestroyNotify) g_object_unref);
-
- gtk_container_add (GTK_CONTAINER (container),
- container->priv->socket);
- gtk_widget_show (container->priv->socket);
}
static void
+panel_applet_container_setup (MatePanelAppletContainer *container)
+{
+ if (container->priv->out_of_process) {
+ container->priv->socket = gtk_socket_new ();
+
+ g_signal_connect_swapped (container->priv->socket,
+ "plug-removed",
+ G_CALLBACK (mate_panel_applet_container_plug_removed),
+ container);
+
+ gtk_container_add (GTK_CONTAINER (container), container->priv->socket);
+ gtk_widget_show (container->priv->socket);
+ } else {
+ GtkWidget *applet;
+
+ applet = mate_panel_applets_manager_get_applet_widget (container->priv->iid, container->priv->uid);
+
+ gtk_container_add (GTK_CONTAINER (container), applet);
+ }
+ }
+
+static void
mate_panel_applet_container_cancel_pending_operations (MatePanelAppletContainer *container)
{
GList *keys, *l;
@@ -135,6 +152,11 @@ mate_panel_applet_container_dispose (GObject *object)
container->priv->bus_name = NULL;
}
+ if (container->priv->iid) {
+ g_free (container->priv->iid);
+ container->priv->iid = NULL;
+ }
+
if (container->priv->name_watcher_id > 0) {
g_bus_unwatch_name (container->priv->name_watcher_id);
container->priv->name_watcher_id = 0;
@@ -349,6 +371,8 @@ on_proxy_appeared (GObject *source_object,
g_simple_async_result_complete (result);
g_object_unref (result);
+ panel_applet_container_setup (container);
+
if (container->priv->xid > 0) {
gtk_socket_add_id (GTK_SOCKET (container->priv->socket),
container->priv->xid);
@@ -496,6 +520,7 @@ mate_panel_applet_container_get_applet (MatePanelAppletContainer *container,
bus_name = g_strdup_printf (MATE_PANEL_APPLET_BUS_NAME, factory_id);
+ container->priv->iid = g_strdup (iid);
container->priv->name_watcher_id =
g_bus_watch_name (G_BUS_TYPE_SESSION,
bus_name,