GNOME Bugzilla – Bug 563635
Don't connect to session manager until we are ready.
Last modified: 2009-01-20 13:47:09 UTC
gnome-session takes our connection as "I'm ready, go ahead and start the next phase (Nautilus)". To avoid Nautilus icons jumping around when we set struts, we should set the struts before connecting to session. For the Nautilus thing to work correctly other changes are also needed. This is just one piece of the solution.
Created attachment 124141 [details] [review] The patch
+ /* Why is the following API deprecated and not working? + * Got to do it the hard way. + * + * gnome_client_disable_master_connection (); + */ I'm not sure why it's deprecated, but you ought to be able to do the same thing by just passing GNOME_CLIENT_PARAM_SM_CONNECT, FALSE in the gnome_program_init() args
(In reply to comment #2) > + /* Why is the following API deprecated and not working? > + * Got to do it the hard way. > + * > + * gnome_client_disable_master_connection (); > + */ > > I'm not sure why it's deprecated, Ok, now I see that the header file does suggest using a property. The gtk-doc docs don't... > but you ought to be able to do the same thing > by just passing > > GNOME_CLIENT_PARAM_SM_CONNECT, FALSE > > in the gnome_program_init() args Right... I read gnome_client_post_args_parse() but somehow missed this line: g_object_get (G_OBJECT (app), GNOME_CLIENT_PARAM_SM_CONNECT, &do_connect, NULL); So yeah, this patch can be reworked a bit.
Created attachment 124185 [details] [review] New patch Have not tested.
Created attachment 124220 [details] [review] bla bla bla Patch that actually compiles. I can't check if it works or not -- login is too fast here anyway... One minor issue is that we lose --sm-disable this way. Not sure it's a big issue, especially if we remove most libgnome usage there.
To test it, add a sleep(5) before the panel_session_init() line. Nautilus should not start in that 5 seconds.
Works fine, committed. I'm not sure we'll be able to do the same thing with eggsmclient. It looks like there's a post-options-parsing function that automatically connects to the session manager... Actually, let me add a comment to the code so I don't forget this when migrating.
(In reply to comment #7) > Works fine, committed. > I'm not sure we'll be able to do the same thing with eggsmclient. It looks like > there's a post-options-parsing function that automatically connects to the > session manager... Yeah. Originally it waited until main-loop-time, but this can cause problems, because you can't call gdk_set_sm_client_id() after creating any windows, so if the app creates windows before the main loop starts, and it doesn't already know its sm_client_id (via command line or environment variable), then the window manager would end up thinking it was non-session-managed. Of course, in the panel's case, that problem wouldn't occur, because it *does* always know its client ID at startup. So EggSMClient needs to be fixed to put back the delay in that case. (Maybe it also needs an explicit "don't connect until I tell you do" API too.)