GNOME Bugzilla – Bug 337540
[PATCH] Port to use dbus
Last modified: 2006-06-11 18:39:19 UTC
Attached in a minute with comments
Created attachment 62873 [details] [review] Patch OK, here we go... This removes bonobo-activation in favour of dbus based activation. Why? I wanted to see how dbus worked. The patch doesn't add a server file (i.e. other applications can't call yelp methods on the dbus bus). This is the basic work needed to move to dbus. It also cleans up the yelp-main and src/Makefile.am files somewhat. I'm not sure about the save- and restore-session code as I haven't properly tested it, but it seems to work okay from my basic testing. The save-session stuff in yelp-base returns the result as a single (concatted) string. For some reason, I couldn't get string arrays to work properly without segfaulting :( It also won't compile (for me at least) due to: https://bugs.freedesktop.org/show_bug.cgi?id=6358 (which may well be my fault) In addition, the idl directory in the top level directory can be removed with this patch.
> It also won't compile (for me at least) due to: > https://bugs.freedesktop.org/show_bug.cgi?id=6358 > (which may well be my fault) won't compile => won't compile without modifications. Changing the line: DBusGAsyncData *data = user_data; to DBusGAsyncData *data = (DBusGAsyncData *) user_data; in $PREFIX/include/dbus-1.0/dbus/dbus-glib-bindings.h solves the compilation problem (all 15 or so instances).
Btw and just FYI (not sure it this will apply to this patch), we got lot of flames from porting epiphany from bonobo to dbus, due to the need to have a session bus running, e.g. making it difficult to run it from remote hosts. Also when the user logs in a 2nd time to the session, the session dbus will be different, so unicity isn't guaranteed (not as bad in yelp as in ephy since yelp doesn't use a mozilla profile)...
Created attachment 67089 [details] [review] Updated patch Un-bit-rotted. Also update to work around the problem above, allowing compilation without altering any files from dbus. My experience is that yelp with dbus starts up quicker (only ~ 0.2-0.3 s quicker, but still noticable). Opening a second window seems to take ~ half the time compared to using bonobo. Some other advantages: We can specify (somewhat more easily) to not start using dbus, but start a completely new process (bug #154235) We can (at some point) provide dbus signals to access help files, removing the need for people to call yelp through libgnome. Plus, yelp-main.c and yelp-base.c seems to be somewhat cleaner using this way.
I'm all for this patch going in if we can just start a private session if a dbus session is not available. From IRC: smitten chpe: did you make epiphany still start if the session bus is not running? smitten we want to move yelp to dbus, but would like to work around a non-existent session bus * Burgundavia hugs smitten reinouts smitten: epiphany has a -p (private instance) option that just ignores dbus but maybe that's not exactly what you need smitten I think that would be fine smitten i'll check out the code chpe smitten: not really, no. -p was added for other reasons (helping me develop ephy while runinng as main browser too)... chpe smitten: although yelp has it easier, since ephy does this because it cannot share the profile, but yelp has no gecko profile chpe smitten: so for yelp, it probably is fine to just start a unique instance if dbus isn't available smitten ok smitten thanks chpe/reinouts
Created attachment 67125 [details] [review] Updated patch Add a {-p,--private-session} flag to the command line options. If set, or the session bus can't be found, fall back to ignoring dbus entirely, creating a new process and base instance etc. Refactored some of the stuff in yelp-base.c to accomodate this.
Patch applied. Closing. 2006-06-11 Don Scorgie <dscorgie@cvs.gnome.org> * src/yelp-main.c: * src/yelp-infos.xml: * src/yelp-base.h: * src/yelp-base.c: * src/Makefile.am: * Makefile.am: * configure.in: Move from bonobo activation to dbus activation Add {-p,--private-session} flag to stop from activating If dbus isn't running, fallback to private session Bug #337540