After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 563635 - Don't connect to session manager until we are ready.
Don't connect to session manager until we are ready.
Status: RESOLVED FIXED
Product: gnome-panel
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Panel Maintainers
Panel Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-12-08 05:13 UTC by Behdad Esfahbod
Modified: 2009-01-20 13:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The patch (2.85 KB, patch)
2008-12-08 05:14 UTC, Behdad Esfahbod
none Details | Review
New patch (2.04 KB, patch)
2008-12-08 16:18 UTC, Behdad Esfahbod
none Details | Review
bla bla bla (1.78 KB, patch)
2008-12-09 00:12 UTC, Vincent Untz
committed Details | Review

Description Behdad Esfahbod 2008-12-08 05:13:34 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.
Comment 1 Behdad Esfahbod 2008-12-08 05:14:10 UTC
Created attachment 124141 [details] [review]
The patch
Comment 2 Dan Winship 2008-12-08 15:50:19 UTC
+	/* 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
Comment 3 Behdad Esfahbod 2008-12-08 16:00:35 UTC
(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.
Comment 4 Behdad Esfahbod 2008-12-08 16:18:05 UTC
Created attachment 124185 [details] [review]
New patch

Have not tested.
Comment 5 Vincent Untz 2008-12-09 00:12:20 UTC
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.
Comment 6 Behdad Esfahbod 2008-12-09 08:54:36 UTC
To test it, add a sleep(5) before the panel_session_init() line.  Nautilus should not start in that 5 seconds.
Comment 7 Vincent Untz 2009-01-20 12:35:38 UTC
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.
Comment 8 Dan Winship 2009-01-20 13:47:09 UTC
(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.)