diff options
author | lukefromdc <[email protected]> | 2017-07-14 03:21:51 -0400 |
---|---|---|
committer | lukefromdc <[email protected]> | 2017-08-13 14:37:24 -0400 |
commit | 109dc78304c309c368b95df17ee9a057fbb72402 (patch) | |
tree | c152dd9cb72166c57499119cbe429dbf92560c73 /libmate-panel-applet | |
parent | 025a11fdaa76111afc8e03faf6ac36b17028e585 (diff) | |
download | mate-panel-109dc78304c309c368b95df17ee9a057fbb72402.tar.bz2 mate-panel-109dc78304c309c368b95df17ee9a057fbb72402.tar.xz |
libpanel-applet: add process type to private data
We will need to know this as soon we will create GtkPlug and
GtkSocket only for out of process applets.
based on https://github.com/GNOME/gnome-panel/commit/dafdc5714a6cfc7ebf26fcbd614b48cfc790b954
Diffstat (limited to 'libmate-panel-applet')
-rw-r--r-- | libmate-panel-applet/mate-panel-applet-factory.c | 4 | ||||
-rw-r--r-- | libmate-panel-applet/mate-panel-applet-factory.h | 1 | ||||
-rw-r--r-- | libmate-panel-applet/mate-panel-applet.c | 19 |
3 files changed, 23 insertions, 1 deletions
diff --git a/libmate-panel-applet/mate-panel-applet-factory.c b/libmate-panel-applet/mate-panel-applet-factory.c index 82d256ac..63f41950 100644 --- a/libmate-panel-applet/mate-panel-applet-factory.c +++ b/libmate-panel-applet/mate-panel-applet-factory.c @@ -28,6 +28,7 @@ struct _MatePanelAppletFactory { gchar *factory_id; guint n_applets; + gboolean out_of_process; GType applet_type; GClosure *closure; }; @@ -83,6 +84,7 @@ mate_panel_applet_factory_applet_removed (MatePanelAppletFactory *factory, MatePanelAppletFactory * mate_panel_applet_factory_new (const gchar *factory_id, + gboolean out_of_process, GType applet_type, GClosure *closure) { @@ -90,6 +92,7 @@ mate_panel_applet_factory_new (const gchar *factory_id, factory = MATE_PANEL_APPLET_FACTORY (g_object_new (PANEL_TYPE_APPLET_FACTORY, NULL)); factory->factory_id = g_strdup (factory_id); + factory->out_of_process = out_of_process; factory->applet_type = applet_type; factory->closure = g_closure_ref (closure); @@ -150,6 +153,7 @@ mate_panel_applet_factory_get_applet (MatePanelAppletFactory *factory, g_variant_get (parameters, "(&si@a{sv})", &applet_id, &screen_num, &props); applet = g_object_new (factory->applet_type, + "out-of-process", factory->out_of_process, "id", applet_id, "connection", connection, "closure", factory->closure, diff --git a/libmate-panel-applet/mate-panel-applet-factory.h b/libmate-panel-applet/mate-panel-applet-factory.h index 52fb23b4..4bffc444 100644 --- a/libmate-panel-applet/mate-panel-applet-factory.h +++ b/libmate-panel-applet/mate-panel-applet-factory.h @@ -40,6 +40,7 @@ typedef struct _MatePanelAppletFactoryClass MatePanelAppletFactoryClass; GType mate_panel_applet_factory_get_type (void) G_GNUC_CONST; MatePanelAppletFactory *mate_panel_applet_factory_new (const gchar *applet_id, + gboolean out_of_process, GType applet_type, GClosure *closure); gboolean mate_panel_applet_factory_register_service (MatePanelAppletFactory *factory); diff --git a/libmate-panel-applet/mate-panel-applet.c b/libmate-panel-applet/mate-panel-applet.c index c83e5671..4f7f430f 100644 --- a/libmate-panel-applet/mate-panel-applet.c +++ b/libmate-panel-applet/mate-panel-applet.c @@ -55,6 +55,8 @@ struct _MatePanelAppletPrivate { GtkWidget *applet; GDBusConnection *connection; + gboolean out_of_process; + char *id; GClosure *closure; char *object_path; @@ -97,6 +99,7 @@ static guint mate_panel_applet_signals[LAST_SIGNAL] = { 0 }; enum { PROP_0, + PROP_OUT_OF_PROCESS, PROP_ID, PROP_CLOSURE, PROP_CONNECTION, @@ -1619,6 +1622,9 @@ mate_panel_applet_get_property (GObject *object, MatePanelApplet *applet = MATE_PANEL_APPLET (object); switch (prop_id) { + case PROP_OUT_OF_PROCESS: + g_value_set_boolean (value, applet->priv->out_of_process); + break; case PROP_ID: g_value_set_string (value, applet->priv->id); break; @@ -1677,6 +1683,9 @@ mate_panel_applet_set_property (GObject *object, MatePanelApplet *applet = MATE_PANEL_APPLET (object); switch (prop_id) { + case PROP_OUT_OF_PROCESS: + applet->priv->out_of_process = g_value_get_boolean (value); + break; case PROP_ID: applet->priv->id = g_value_dup_string (value); break; @@ -1923,6 +1932,14 @@ mate_panel_applet_class_init (MatePanelAppletClass *klass) g_type_class_add_private (klass, sizeof (MatePanelAppletPrivate)); g_object_class_install_property (gobject_class, + PROP_OUT_OF_PROCESS, + g_param_spec_boolean ("out-of-process", + "out-of-process", + "out-of-process", + TRUE, + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, PROP_ID, g_param_spec_string ("id", "Id", @@ -2311,7 +2328,7 @@ _mate_panel_applet_factory_main_internal (const gchar *factory_id, } closure = g_cclosure_new(G_CALLBACK(callback), user_data, NULL); - factory = mate_panel_applet_factory_new(factory_id, applet_type, closure); + factory = mate_panel_applet_factory_new(factory_id, out_process, applet_type, closure); g_closure_unref(closure); if (mate_panel_applet_factory_register_service(factory)) |