GNOME Bugzilla – Bug 533537
Tomboy applet shouldn't connect to session manager
Last modified: 2009-10-04 00:48:03 UTC
As a general rule, applets shouldn't connect to session manager as they're already managed by gnome-panel. Tomboy should only connect to session when started as a standalone app.
I'm not sure if this bug is still valid considering some refactoring we've done. Also, I'm not really sure how to test if I have connected to the session. If "tomboy" shows up under "Currently running programs" in the "Current Session" tab of Session Preferences, do that mean it has connected to the session? I see hamster in there but not gnome-main-menu. Looks like the only thing we do as an applet is this: // Register handler for saving session when logging out of Gnome Gnome.Client client = Gnome.Global.MasterClient (); client.SaveYourself += OnSaveYourself; Is even this considered connecting to the session? Thanks for your help!
Yes, this is connecting to the session, and yes, this is inappropriate for applets. It causes tomboy to be started twice when resuming a session (once from the panel config, and then by the session manager), and for some reason, that causes it to pop up the search window. A simple workaround that I am going to put into Fedora now is to unset the SESSION_MANAGER envvar in tomboy-panel before execing tomboy.
Thanks Matthias. I'll try to get this fixed before code freeze. The reason the Search window pops up is because when Tomboy detects it is already running, it brings up the Search UI (to help with the common case of a user not realizing that Tomboy runs in their panel/tray, and attempting to summon it via the GNOME main menu).
Created attachment 130670 [details] [review] Proposed patch Move session saving code to RegisterSessionManagerRestart method (seems like a good place, ya?). Setting up a GNOME 2.25.x environment so I can test. Trying to help move bug #552387 along.
So that patch doesn't really cut it. I have another one that's a bit more thorough but it doesn't really matter. Need to do the equivalent of Matthias' work-around or else Tomboy automatically becomes part of the session. Can just add --sm-disable to Tomboy exec command in tomboy-panel. The problem with this is that then, if you have session save enabled, and you have Tomboy windows open when you log out, you get an annoying "are you sure" dialog letting you know that the Tomboy windows aren't part of the session. Not happy with this solution.
*** Bug 581839 has been marked as a duplicate of this bug. ***
Session save appears to be fixed in Ubuntu Jaunty and other recent distro releases. When enabled by Tomboy panel applet users, OAFIID message often appears because GNOME session is starting Tomboy in the tray before the panel applet is started. This is really ugly, we need a better fix ASAP. Would love for somebody on Jaunty or another affected distro to test out a solution that works well given the issues I raised in comment #5.
I noticed this a while back in Tomboy and just stopped using Save Session. I just had a similar problem to this when using Glipper*, except that it happened everytime I started Glipper - not just save session. The issue with Glipper was that it would always start before the panel started. By adding a simple timed delay to Glipper starting up (see the workaround here: https://bugs.launchpad.net/ubuntu/+source/glipper/+bug/213494 ) its stopped Glipper from launching before the panel. I wonder if the same logic would apply here. Not an ideal solution, but maybe it would work? The proposed workaround says 8 seconds but since my session loads slowly I delay 30 seconds and it's not noticeable to me. *Yes, Glipper is no longer actively maintained AFAIK but I think the same logic still applies here for Tomboy, unless I misunderstood something in Comment #5.
Upon testing again in Ubuntu Jaunty, the problem I mentioned with --sm-disable (a warning when logging out with Tomboy windows open) does not seem to exist. Assuming this is the same upstream, I'm going to apply that fix and close this bug. Hopefully folks will try today's release out on various distros and let me know how it goes.
Fixed in 0.15.7. I've only tested the fix in an Ubuntu Jaunty VM (and openSUSE 11.1 where session save is broken afaik, since it's GNOME 2.24). Please try it out on your favorite distro so we can make sure the upcoming stable release has the right fix.