Re: bonobo_get_object_async (take 2)...



On Fri, 2006-02-03 at 15:03 +0000, michael meeks wrote:
> Hi Mark,
> 
> 	Please find attached trivial patch to gnome-session making the vino
> activation (more) truly async & hence not blocking login etc. until it's
> started :-) [ should also avoid loading those pesky moniker libraries
> too I think ;-] (can I/Rodrigo commit & to the stable branch too ?).
> 
> 	Rodrigo is also looking at the panel which uses the same method (with
> commensurate performance problems I'd guess) - hopefully we can get an
> easy win there too.
> 
yes, attached is panel's patch, which loads really asynchronously all
applets.

Vincent, is this ok to commit? Can we commit also to the 2.12 branch?
(we committed similar fixes to gnome-session for 2.12 also)
-- 
Rodrigo Moya <rodrigo novell com>
? battery.c
? org.gnome.Panel.desktop-service
? org.gnome.Panel.service
? org.gnome.Panel.service.in
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/ChangeLog,v
retrieving revision 1.2755
diff -u -p -r1.2755 ChangeLog
--- ChangeLog	27 Jan 2006 18:13:57 -0000	1.2755
+++ ChangeLog	3 Feb 2006 15:26:41 -0000
@@ -1,3 +1,10 @@
+2006-02-03  Rodrigo Moya <rodrigo novell com>
+
+	* panel-applet-frame.c (panel_applet_frame_load): use
+	bonobo_activation_activate_from_id_async instead of not-really-async
+	bonobo_get_object_async.
+	(panel_applet_frame_activated): changed to correct signature.
+
 ==================== 2.13.90 ====================
 
 2006-01-27  Vincent Untz  <vuntz gnome org>
Index: panel-applet-frame.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/panel-applet-frame.c,v
retrieving revision 1.144
diff -u -p -r1.144 panel-applet-frame.c
--- panel-applet-frame.c	22 Jan 2006 15:30:17 -0000	1.144
+++ panel-applet-frame.c	3 Feb 2006 15:26:41 -0000
@@ -101,9 +101,9 @@ static char *panel_applet_frame_construc
 						   const char       *iid,
 						   const char       *id);
 
-static void panel_applet_frame_activated (Bonobo_Unknown     object,
-					  CORBA_Environment *ev,
-					  gpointer          *data);
+static void panel_applet_frame_activated (CORBA_Object object,
+					  const char   *error_reason,
+					  gpointer     data);
 
 void
 panel_applet_frame_sync_menu_state (PanelAppletFrame *frame)
@@ -349,9 +349,9 @@ panel_applet_frame_load (const gchar *ii
 
 	CORBA_exception_init (&ev);
 
-	bonobo_get_object_async (moniker, "IDL:Bonobo/Control:1.0", &ev,
-				 (BonoboMonikerAsyncFn) panel_applet_frame_activated,
-				 frame_act);
+	bonobo_activation_activate_from_id_async ("IDL:Bonobo/Control:1.0", 0,
+						  (BonoboActivationCallback) panel_applet_frame_activated,
+						  frame_act, &ev);
 
 	g_free (moniker);
 }
@@ -1237,9 +1237,9 @@ panel_applet_frame_event_listener (Bonob
 }
 
 static void
-panel_applet_frame_activated (Bonobo_Unknown     object,
-			      CORBA_Environment *ev,
-			      gpointer          *data)
+panel_applet_frame_activated (CORBA_Object   object, 
+			      const char    *error_reason, 
+			      gpointer       data)
 {
 	PanelAppletFrameActivating *frame_act;
 	PanelAppletFrame   *frame;
@@ -1255,14 +1255,12 @@ panel_applet_frame_activated (Bonobo_Unk
 
 	/* according to the source of bonobo control == NULL && no
 	   exception can happen, so handle it */
-	if (BONOBO_EX (ev) || object == CORBA_OBJECT_NIL) {
-		error = bonobo_exception_get_text (ev);
+	if (error_reason) {
 		g_warning (G_STRLOC ": failed to load applet %s:\n%s",
-			   frame->priv->iid, error);
+			   frame->priv->iid, error_reason);
 		panel_applet_frame_loading_failed (frame, frame_act->id);
 		g_free (frame_act->id);
 		g_free (frame_act);
-		g_free (error);
 		return;
 	}
 


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