GNOME Bugzilla – Bug 694876
we register with session manager too earlier
Last modified: 2013-03-01 16:32:18 UTC
gnome-session waits until the shell registers with the session manager before continuing startup. This synchronization point is important because the things that are started after the shell depend on the shell being fully functional. Unfortunately, we tell the session manager too early that we're ready. mutter does it implicitly as soon as we start the main loop. For instance, in classic mode, nautilus is started before we've initialized the workspace layout causing weird behavior. We either need to move all "important" initialization to before we go into the main loop, or we need to explicitly register with the session manager with a new mutter api.
Created attachment 237618 [details] [review] core: make session registration an explicit step gnome-shell shouldn't announce to the session manager it's "ready" until it's fully initialized. It currently tells the session manager it's ready as soon as it hits the main loop. This causes nautilus in classic mode to start before we have workspaces initialized.
Created attachment 237619 [details] [review] main: register with session manager explicitly Mutter now makes session registration an explicit required step. This is so we can tell the session manager when we're ready to move on to the next phase. This commit calls the new Meta.register() api after we're initialized.
Review of attachment 237618 [details] [review]: ::: src/core/main.c @@ +449,2 @@ /** + * meta_register: Can we call this meta_register_session (or another non ambiguous name)? @@ -512,3 @@ - - /* Connect to SM as late as possible - but before managing display, - * or we might try to manage a window before we have the session ^ This comment. We must load the session info before we start managing windows, so it must be decoupled from session registration.
Review of attachment 237619 [details] [review]: Ok.
(In reply to comment #3) > Review of attachment 237618 [details] [review]: > > ::: src/core/main.c > @@ +449,2 @@ > /** > + * meta_register: > > Can we call this meta_register_session (or another non ambiguous name)? sure. > @@ -512,3 @@ > - > - /* Connect to SM as late as possible - but before managing display, > - * or we might try to manage a window before we have the session > > ^ This comment. > We must load the session info before we start managing windows, so it must be > decoupled from session registration. don't grok what you're saying here
Created attachment 237641 [details] [review] core: make session registration an explicit step gnome-shell shouldn't announce to the session manager it's "ready" until it's fully initialized. It currently tells the session manager it's ready as soon as it hits the main loop. This causes nautilus in classic mode to start before we have workspaces initialized.
I'm saying that meta_session_init() loads the session state, which is needed before we start managing windows (otherwise they don't get matched correctly, and their position and state is not restored). So you need to split meta_session_init() in a part that loads the state and a part that connects to gnome-session. Arguably, we could ditch the whole of XSMP, require client-side saving and move to DBus...
we're not displaying any windows until this phase of startup is over
Well, we could ditch the XML session saving for a start, without ditching XSMP entirely.
we can't ditch XSMP (including the half of the protocol responsibility the window manager is in charge of) without laying the stage for a replacement, which is a big task and separate from this bug.
(In reply to comment #10) > we can't ditch XSMP [...] without laying the stage for a replacement, > which is [...] separate from this bug. Not to mention completely out of question for 3.8 ...
Okay, i'm probably going to push this soon if there are no unaddressed concerns
Comment on attachment 237641 [details] [review] core: make session registration an explicit step Attachment 237641 [details] pushed as 773ae8d - core: make session registration an explicit step
Attachment 237619 [details] pushed as 57eae1b - main: register with session manager explicitly