--- a/patches/gnome-panel-11-lockdown-applets.diff Thu Jan 29 16:28:33 2009 +0000
+++ b/patches/gnome-panel-11-lockdown-applets.diff Thu Jan 29 16:46:38 2009 +0000
@@ -1,22 +1,7 @@
---- gnome-panel-2.23.6.old/gnome-panel/panel-applet-frame.h 2008-08-18 15:05:36.136359000 +0100
-+++ gnome-panel-2.23.6/gnome-panel/panel-applet-frame.h 2008-08-18 15:06:21.011256000 +0100
-@@ -77,6 +77,13 @@
-
- void panel_applet_frame_set_panel (PanelAppletFrame *frame,
- PanelWidget *panel);
-+/**
-+ * Checks whether the applet has been disabled or reenabled and if necessary
-+ * rebuilds the applet.
-+ * Returns true if the applet frame was rebuilt as a result of its restriction
-+ * status changing.
-+ */
-+gboolean panel_applet_frame_refresh (PanelAppletFrame *frame);
-
- G_END_DECLS
-
---- gnome-panel-2.23.6.old/gnome-panel/applet.c 2008-08-18 15:05:36.144491000 +0100
-+++ gnome-panel-2.23.6/gnome-panel/applet.c 2008-08-18 15:16:12.926256000 +0100
-@@ -158,6 +158,31 @@
+/jds/bin/diff -uprN gnome-panel-2.25.5.1.old/gnome-panel/applet.c gnome-panel-2.25.5.1/gnome-panel/applet.c
+--- gnome-panel-2.25.5.1.old/gnome-panel/applet.c 2009-01-29 18:11:25.531697000 +0000
++++ gnome-panel-2.25.5.1/gnome-panel/applet.c 2009-01-29 18:15:26.437406000 +0000
+@@ -160,6 +160,31 @@ panel_applet_recreate_menu (AppletInfo *
info->menu = panel_applet_create_menu (info);
}
@@ -48,29 +33,46 @@
static void
panel_applet_locked_change_notify (GConfClient *client,
guint cnxn_id,
-@@ -751,8 +776,7 @@
+@@ -753,8 +778,7 @@ panel_applet_destroy (GtkWidget *widget
}
}
- if (info->type != PANEL_OBJECT_BONOBO)
- panel_lockdown_notify_remove (G_CALLBACK (panel_applet_recreate_menu),
-+ panel_lockdown_notify_remove (G_CALLBACK (panel_applet_refresh_state),
++ panel_lockdown_notify_remove (G_CALLBACK (panel_applet_recreate_menu),
info);
if (info->menu)
-@@ -1195,8 +1219,7 @@
+@@ -1248,8 +1272,7 @@ panel_applet_register (GtkWidget *
g_object_set_data (G_OBJECT (applet), "applet_info", info);
- if (type != PANEL_OBJECT_BONOBO)
- panel_lockdown_notify_add (G_CALLBACK (panel_applet_recreate_menu),
-+ panel_lockdown_notify_add (G_CALLBACK (panel_applet_refresh_state),
++ panel_lockdown_notify_add (G_CALLBACK (panel_applet_recreate_menu),
info);
key = panel_gconf_full_key ((type == PANEL_OBJECT_BONOBO) ?
-/jds/bin/diff -uprN gnome-panel-2.25.3.old/gnome-panel/panel-applet-frame.c gnome-panel-2.25.3/gnome-panel/panel-applet-frame.c
---- gnome-panel-2.25.3.old/gnome-panel/panel-applet-frame.c 2009-01-13 18:19:15.116088000 +0000
-+++ gnome-panel-2.25.3/gnome-panel/panel-applet-frame.c 2009-01-13 18:32:36.591189000 +0000
+/jds/bin/diff -uprN gnome-panel-2.25.5.1.old/gnome-panel/panel-applet-frame.h gnome-panel-2.25.5.1/gnome-panel/panel-applet-frame.h
+--- gnome-panel-2.25.5.1.old/gnome-panel/panel-applet-frame.h 2009-01-29 18:11:25.530025000 +0000
++++ gnome-panel-2.25.5.1/gnome-panel/panel-applet-frame.h 2009-01-29 18:12:31.992992000 +0000
+@@ -77,6 +77,13 @@ void panel_applet_frame_load_from_
+
+ void panel_applet_frame_set_panel (PanelAppletFrame *frame,
+ PanelWidget *panel);
++/**
++ * Checks whether the applet has been disabled or reenabled and if necessary
++ * rebuilds the applet.
++ * Returns true if the applet frame was rebuilt as a result of its restriction
++ * status changing.
++ */
++gboolean panel_applet_frame_refresh (PanelAppletFrame *frame);
+
+ G_END_DECLS
+
+/jds/bin/diff -uprN gnome-panel-2.25.5.1.old/gnome-panel/panel-applet-frame.c gnome-panel-2.25.5.1/gnome-panel/panel-applet-frame.c
+--- gnome-panel-2.25.5.1.old/gnome-panel/panel-applet-frame.c 2009-01-29 18:11:25.533599000 +0000
++++ gnome-panel-2.25.5.1/gnome-panel/panel-applet-frame.c 2009-01-29 18:23:01.023957000 +0000
@@ -118,6 +118,10 @@ panel_applet_frame_sync_menu_state (Pane
movable = panel_applet_can_freely_move (frame->priv->applet_info);
removable = panel_profile_id_lists_are_writable ();
@@ -97,6 +99,10 @@
frame_act->id = g_strdup (id);
- CORBA_exception_init (&ev);
+-
+- bonobo_activation_activate_from_id_async (frame->priv->iid, 0,
+- (BonoboActivationCallback) panel_applet_frame_activated,
+- frame_act, &ev);
+ /* If the applet is disabled, we don't actually load the bonobo component,
+ but keep the objects around so that, should the disabled state change,
+ we'll be able to reload the applet in its proper state. */
@@ -110,10 +116,6 @@
+ (BonoboActivationCallback) panel_applet_frame_activated,
+ frame_act, &ev);
-- bonobo_activation_activate_from_id_async (frame->priv->iid, 0,
-- (BonoboActivationCallback) panel_applet_frame_activated,
-- frame_act, &ev);
--
- CORBA_exception_free (&ev);
+ CORBA_exception_free (&ev);
+ }
@@ -204,7 +206,7 @@
} else if (info) {
/* if we can't write to applets list we can't really delete
it, so we'll just ignore this. FIXME: handle this
-@@ -1280,169 +1308,174 @@ panel_applet_frame_activated (CORBA_Obje
+@@ -1281,140 +1309,145 @@ panel_applet_frame_activated (CORBA_Obje
frame_act = (PanelAppletFrameActivating *) data;
frame = frame_act->frame;
@@ -213,10 +215,7 @@
- if (error_reason != NULL || object == CORBA_OBJECT_NIL) {
- g_warning (G_STRLOC ": failed to load applet %s:\n%s",
- frame->priv->iid, error_reason);
-- panel_applet_frame_loading_failed (frame, frame_act->id);
-- g_free (frame_act->id);
-- g_free (frame_act);
-- return;
+- goto error_out;
- }
-
- CORBA_exception_init (&corba_ev);
@@ -253,13 +252,10 @@
- error = bonobo_exception_get_text (&corba_ev);
- g_warning (G_STRLOC ": failed to get Bonobo/Control interface on applet %s:\n%s",
- frame->priv->iid, error);
-- panel_applet_frame_loading_failed (frame, frame_act->id);
- CORBA_exception_free (&corba_ev);
- bonobo_object_release_unref (object, NULL);
-- g_free (frame_act->id);
-- g_free (frame_act);
- g_free (error);
-- return;
+- goto error_out;
- }
-
- widget = bonobo_widget_new_control_from_objref (frame->priv->control,
@@ -271,56 +267,16 @@
- if (!widget) {
- g_warning (G_STRLOC ": failed to load applet %s",
- frame->priv->iid);
-- panel_applet_frame_loading_failed (frame, frame_act->id);
-- g_free (frame_act->id);
-- g_free (frame_act);
-- return;
-- }
--
-- control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (widget));
-- if (control_frame == NULL) {
-- g_warning (G_STRLOC ": failed to load applet %s "
-- "(cannot get control frame)", frame->priv->iid);
-- panel_applet_frame_loading_failed (frame, frame_act->id);
-- g_object_unref (widget);
-- g_free (frame_act->id);
-- g_free (frame_act);
-- return;
+- goto error_out;
- }
--
-- frame->priv->property_bag =
-- bonobo_control_frame_get_control_property_bag (control_frame,
-- &corba_ev);
-- if (frame->priv->property_bag == NULL || BONOBO_EX (&corba_ev)) {
-- error = bonobo_exception_get_text (&corba_ev);
-- CORBA_exception_free (&corba_ev);
-- g_warning (G_STRLOC ": failed to load applet %s "
-- "(cannot get property bag):\n%s",
-- frame->priv->iid, error);
-- panel_applet_frame_loading_failed (frame, frame_act->id);
-- g_object_unref (widget);
-- g_free (frame_act->id);
-- g_free (frame_act);
-- g_free (error);
-- return;
-- }
--
-- bonobo_event_source_client_add_listener (frame->priv->property_bag,
-- (BonoboListenerCallbackFn) panel_applet_frame_event_listener,
-- "Bonobo/Property:change:panel-applet",
-- NULL,
-- frame);
+ if (error_reason == NULL ||
+ (error_reason != NULL && strncmp (error_reason, "LOCKED", 6) != 0)) {
+ /* according to the source of bonobo control == NULL && no
-+ exception can happen, so handle it */
++ exception can happen, so handle it */
+ if (error_reason != NULL || object == CORBA_OBJECT_NIL) {
+ g_warning (G_STRLOC ": failed to load applet %s:\n%s",
+ frame->priv->iid, error_reason);
-+ panel_applet_frame_loading_failed (frame, frame_act->id);
-+ g_free (frame_act->id);
-+ g_free (frame_act);
-+ return;
++ goto error_out;
+ }
+
+ CORBA_exception_init (&corba_ev);
@@ -335,19 +291,19 @@
+ &corba_ev);
+ if (!BONOBO_EX (&corba_ev) && container != CORBA_OBJECT_NIL) {
+ Bonobo_Unknown containee;
-+
++
+ containee = Bonobo_ItemContainer_getObjectByName (container,
+ item_name,
+ TRUE,
+ &corba_ev);
+ bonobo_object_release_unref (container, NULL);
-+
++
+ if (!BONOBO_EX (&corba_ev) && containee != CORBA_OBJECT_NIL) {
+ frame->priv->control =
+ Bonobo_Unknown_queryInterface (containee,
+ "IDL:Bonobo/Control:1.0",
+ &corba_ev);
-+
++
+ bonobo_object_release_unref (containee, NULL);
+ }
+ }
@@ -357,15 +313,12 @@
+ error = bonobo_exception_get_text (&corba_ev);
+ g_warning (G_STRLOC ": failed to get Bonobo/Control interface on applet %s:\n%s",
+ frame->priv->iid, error);
-+ panel_applet_frame_loading_failed (frame, frame_act->id);
+ CORBA_exception_free (&corba_ev);
+ bonobo_object_release_unref (object, NULL);
-+ g_free (frame_act->id);
-+ g_free (frame_act);
+ g_free (error);
-+ return;
++ goto error_out;
+ }
-+
++
+ widget = bonobo_widget_new_control_from_objref (frame->priv->control,
+ CORBA_OBJECT_NIL);
+
@@ -375,38 +328,51 @@
+ if (!widget) {
+ g_warning (G_STRLOC ": failed to load applet %s",
+ frame->priv->iid);
-+ panel_applet_frame_loading_failed (frame, frame_act->id);
-+ g_free (frame_act->id);
-+ g_free (frame_act);
-+ return;
++ goto error_out;
+ }
+
+ control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (widget));
+ if (control_frame == NULL) {
+ g_warning (G_STRLOC ": failed to load applet %s "
+ "(cannot get control frame)", frame->priv->iid);
-+ panel_applet_frame_loading_failed (frame, frame_act->id);
-+ g_object_unref (widget);
-+ g_free (frame_act->id);
-+ g_free (frame_act);
-+ return;
++ goto error_out;
+ }
-+
+
+- control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (widget));
+- if (control_frame == NULL) {
+- g_warning (G_STRLOC ": failed to load applet %s "
+- "(cannot get control frame)", frame->priv->iid);
+- goto error_out;
+- }
+-
+- frame->priv->property_bag =
+- bonobo_control_frame_get_control_property_bag (control_frame,
+ frame->priv->property_bag =
+ bonobo_control_frame_get_control_property_bag (control_frame,
-+ &corba_ev);
+ &corba_ev);
+- if (frame->priv->property_bag == NULL || BONOBO_EX (&corba_ev)) {
+- error = bonobo_exception_get_text (&corba_ev);
+- CORBA_exception_free (&corba_ev);
+- g_warning (G_STRLOC ": failed to load applet %s "
+- "(cannot get property bag):\n%s",
+- frame->priv->iid, error);
+- g_free (error);
+- goto error_out;
+- }
+-
+- bonobo_event_source_client_add_listener (frame->priv->property_bag,
+- (BonoboListenerCallbackFn) panel_applet_frame_event_listener,
+- "Bonobo/Property:change:panel-applet",
+- NULL,
+- frame);
+ if (frame->priv->property_bag == NULL || BONOBO_EX (&corba_ev)) {
+ error = bonobo_exception_get_text (&corba_ev);
+ CORBA_exception_free (&corba_ev);
+ g_warning (G_STRLOC ": failed to load applet %s "
+ "(cannot get property bag):\n%s",
+ frame->priv->iid, error);
-+ panel_applet_frame_loading_failed (frame, frame_act->id);
-+ g_object_unref (widget);
-+ g_free (frame_act->id);
-+ g_free (frame_act);
+ g_free (error);
-+ return;
++ goto error_out;
+ }
+
+ bonobo_event_source_client_add_listener (frame->priv->property_bag,
@@ -424,12 +390,8 @@
- g_warning (G_STRLOC ": failed to load applet %s "
- "(cannot get popup component):\n%s",
- frame->priv->iid, error);
-- panel_applet_frame_loading_failed (frame, frame_act->id);
-- g_object_unref (widget);
-- g_free (frame_act->id);
-- g_free (frame_act);
- g_free (error);
-- return;
+- goto error_out;
- }
-
- bonobo_ui_util_set_ui (frame->priv->ui_component, DATADIR,
@@ -448,11 +410,7 @@
- CORBA_exception_free (&corba_ev);
- g_warning (G_STRLOC ": failed to load applet %s "
- "(cannot get control)", frame->priv->iid);
-- panel_applet_frame_loading_failed (frame, frame_act->id);
-- g_object_unref (widget);
-- g_free (frame_act->id);
-- g_free (frame_act);
-- return;
+- goto error_out;
- }
-
- frame->priv->applet_shell = panel_applet_frame_get_applet_shell (control);
@@ -460,11 +418,7 @@
- CORBA_exception_free (&corba_ev);
- g_warning (G_STRLOC ": failed to load applet %s "
- "(cannot get applet shell)", frame->priv->iid);
-- panel_applet_frame_loading_failed (frame, frame_act->id);
-- g_object_unref (widget);
-- g_free (frame_act->id);
-- g_free (frame_act);
-- return;
+- goto error_out;
- }
-
- CORBA_exception_free (&corba_ev);
@@ -481,12 +435,8 @@
+ g_warning (G_STRLOC ": failed to load applet %s "
+ "(cannot get popup component):\n%s",
+ frame->priv->iid, error);
-+ panel_applet_frame_loading_failed (frame, frame_act->id);
-+ g_object_unref (widget);
-+ g_free (frame_act->id);
-+ g_free (frame_act);
+ g_free (error);
-+ return;
++ goto error_out;
+ }
+
+ bonobo_ui_util_set_ui (frame->priv->ui_component, DATADIR,
@@ -505,11 +455,7 @@
+ CORBA_exception_free (&corba_ev);
+ g_warning (G_STRLOC ": failed to load applet %s "
+ "(cannot get control)", frame->priv->iid);
-+ panel_applet_frame_loading_failed (frame, frame_act->id);
-+ g_object_unref (widget);
-+ g_free (frame_act->id);
-+ g_free (frame_act);
-+ return;
++ goto error_out;
+ }
+
+ frame->priv->applet_shell = panel_applet_frame_get_applet_shell (control);
@@ -517,15 +463,11 @@
+ CORBA_exception_free (&corba_ev);
+ g_warning (G_STRLOC ": failed to load applet %s "
+ "(cannot get applet shell)", frame->priv->iid);
-+ panel_applet_frame_loading_failed (frame, frame_act->id);
-+ g_object_unref (widget);
-+ g_free (frame_act->id);
-+ g_free (frame_act);
-+ return;
++ goto error_out;
+ }
+
+ CORBA_exception_free (&corba_ev);
-+
++
+ ORBit_small_listen_for_broken (object,
+ G_CALLBACK (panel_applet_frame_cnx_broken),
+ frame);
@@ -539,12 +481,12 @@
gtk_widget_show_all (GTK_WIDGET (frame));
info = panel_applet_register (GTK_WIDGET (frame), GTK_WIDGET (frame),
-@@ -1456,7 +1489,10 @@ panel_applet_frame_activated (CORBA_Obje
+@@ -1428,7 +1461,10 @@ panel_applet_frame_activated (CORBA_Obje
GTK_WIDGET (frame), TRUE);
panel_applet_frame_sync_menu_state (frame);
- panel_applet_frame_init_properties (frame);
-+
++
+ if (frame->priv->property_bag) {
+ panel_applet_frame_init_properties (frame);
+ }