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 694321 - gray background shows after login before the shell starts up
gray background shows after login before the shell starts up
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-02-20 23:17 UTC by William Jon McCann
Modified: 2013-03-14 16:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
layout: defer startup animation until background is loaded (4.67 KB, patch)
2013-02-21 04:37 UTC, Ray Strode [halfline]
none Details | Review
video (mov) (293.87 KB, video/quicktime)
2013-02-21 04:55 UTC, William Jon McCann
  Details
main: don't show stage until still frames are loaded (5.67 KB, patch)
2013-02-21 19:42 UTC, Ray Strode [halfline]
reviewed Details | Review
main: don't show stage until still frames are loaded (4.31 KB, patch)
2013-02-21 19:56 UTC, Ray Strode [halfline]
committed Details | Review
compositor: don't show stage right away (8.53 KB, patch)
2013-03-04 03:43 UTC, Ray Strode [halfline]
committed Details | Review
compositor: map overlay window before redirecting windows (6.31 KB, patch)
2013-03-04 03:43 UTC, Ray Strode [halfline]
committed Details | Review
main: don't explicitly hide the stage (2.29 KB, patch)
2013-03-04 03:43 UTC, Ray Strode [halfline]
committed Details | Review
main: defer session update until after startup animation (3.90 KB, patch)
2013-03-04 03:43 UTC, Ray Strode [halfline]
needs-work Details | Review
main: defer session update until startup animation (3.92 KB, patch)
2013-03-04 13:12 UTC, Ray Strode [halfline]
committed Details | Review
main: Merge two different session-mode-updated handlers (1.72 KB, patch)
2013-03-04 19:24 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
Defer initializing UI until after the global session has loaded (2.94 KB, patch)
2013-03-04 19:24 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
main: Merge two different session-mode-updated handlers (1.06 KB, patch)
2013-03-05 05:31 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
Defer initializing UI until after the global session has loaded (2.64 KB, patch)
2013-03-05 05:34 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
Defer initializing UI until after the global session has loaded (2.64 KB, patch)
2013-03-06 19:35 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
main: Remove leftover hunk connection to sessionUpdated (924 bytes, patch)
2013-03-06 23:48 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
layout: Move showing the stage and the startup-prepared signal (3.86 KB, patch)
2013-03-06 23:48 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
main: Show the greeter dialog when we're prepared (1.42 KB, patch)
2013-03-06 23:49 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
main: Do not export DBus interfaces before initializing the UI (1.67 KB, patch)
2013-03-08 20:20 UTC, Florian Müllner
committed Details | Review

Description William Jon McCann 2013-02-20 23:17:33 UTC
When I login from GDM I get a gray background before the shell starts up and shows a real background.
Comment 1 Ray Strode [halfline] 2013-02-21 03:04:02 UTC
you mean solid gray? or the noise texture?
Comment 2 William Jon McCann 2013-02-21 04:04:02 UTC
No texture. Very light gray - close to white.
Comment 3 Ray Strode [halfline] 2013-02-21 04:23:55 UTC
what's the value of

 gsettings get org.gnome.desktop.background primary-color

? How big is your wallpaper image? We changed image loading to be asynchronous. We probably need to introduce a synchronization point at startup.
Comment 4 Ray Strode [halfline] 2013-02-21 04:37:03 UTC
maybe something like...
Comment 5 Ray Strode [halfline] 2013-02-21 04:37:11 UTC
Created attachment 237013 [details] [review]
layout: defer startup animation until background is loaded

The user's wallpaper is loaded asynchronously at startup.
If the wallpaper is big then it may take a long time to load.

We don't currently wait for the background to show up before
proceeding with the startup animation.

If the background takes a long time to load, the user will
experience undesirable flicker at startup.

This commit blocks start up until the background is loaded.
Comment 6 William Jon McCann 2013-02-21 04:55:56 UTC
Created attachment 237015 [details]
video (mov)

This is what I see immediately after alt+f2 r.
Comment 7 Ray Strode [halfline] 2013-02-21 17:31:05 UTC
Looked at this Jon today.  This is a regression caused by 


    65303d027aa8615b6aabb16e8d3308e2ee7de446 
    main: defer startup until we know our session mode
    
    commit 92083eaf76fc7a5c2ecdd182896583ab5026ddf0 made
    session mode loading an asynchronous operation.
    
    Aspects of the session mode aren't known immediately at
    start up. For instance, sessionMode.isGreeter returns
    false for greeter sessions until the asynchronous
    operation completes.
    
    This commit defers start up processing until the session
    mode is fully known.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=682429

Now that loading is done asynchronously we iterate the main loop before taking the still frame and so we end up screenshoting a blank stage.

We can fix this by taking the still frames earlier, but we may just want to use the system noise texture instead of doing the still frames at all.  Current designs always show the system noise texture in these transitions anyway.  Then we can get out of the screenshotting business entirely.
Comment 8 Ray Strode [halfline] 2013-02-21 19:42:18 UTC
Created attachment 237097 [details] [review]
main: don't show stage until still frames are loaded

We sometimes map the stage before we've loaded a background on it
because of a race asynchronously loading the session mode.

This manifests as the startup animating starting over a white
background.

This commit defers showing the stage until after the still frames
are loaded.
Comment 9 Jasper St. Pierre (not reading bugmail) 2013-02-21 19:49:56 UTC
Review of attachment 237097 [details] [review]:

::: js/ui/main.js
@@ +198,3 @@
     // completed IO tasks
     GLib.idle_add(GLib.PRIORITY_LOW, function() {
+        global.stage.show();

Where do you really want the stage to be shown? Here or in startupAnimation?
Comment 10 Ray Strode [halfline] 2013-02-21 19:56:47 UTC
Created attachment 237101 [details] [review]
main: don't show stage until still frames are loaded

We sometimes map the stage before we've loaded a background on it
because of a race asynchronously loading the session mode.

This manifests as the startup animating starting over a white
background.

This commit defers showing the stage until after the still frames
are loaded.
Comment 11 Ray Strode [halfline] 2013-02-21 19:58:26 UTC
(In reply to comment #9)
> Review of attachment 237097 [details] [review]:
> 
> ::: js/ui/main.js
> @@ +198,3 @@
>      // completed IO tasks
>      GLib.idle_add(GLib.PRIORITY_LOW, function() {
> +        global.stage.show();
> 
> Where do you really want the stage to be shown? Here or in startupAnimation?

Doesn't matter though, both was obviously wrong.
Comment 12 Jasper St. Pierre (not reading bugmail) 2013-02-21 19:59:12 UTC
Review of attachment 237101 [details] [review]:

Both were wrong, so you... chose one of them?
Comment 13 Jasper St. Pierre (not reading bugmail) 2013-02-21 19:59:31 UTC
Review of attachment 237101 [details] [review]:

Oh, I misunderstood your comment. OK.
Comment 14 Ray Strode [halfline] 2013-02-21 20:03:20 UTC
I guess we'll hold off on the first patch for now, unless it actually ends up being a problem in practice.

Attachment 237101 [details] pushed as c562245 - main: don't show stage until still frames are loaded
Comment 15 Yosef Or Boczko 2013-02-21 20:21:36 UTC
It does not correct the problem:
http://git.gnome.org/browse/gnome-shell/commit/?id=c562245c167cb7b0d027dc5ff3902db4345a12ca
Comment 16 Ray Strode [halfline] 2013-02-21 20:46:47 UTC
Yosef, you're seeing the same issue as the video in comment 6 ?

The patch definitely fixed Jon's issue, we tried it on his machine.
Comment 17 Yosef Or Boczko 2013-02-21 21:02:16 UTC
Yes.
Before Animitziit entrance I see a white background.
Comment 18 Ray Strode [halfline] 2013-02-21 21:45:24 UTC
and you definitely ran "make install" after updating?

Can you open up the installed main.js and see if the global.stage.hide() is in place?
Comment 19 Yosef Or Boczko 2013-02-21 23:23:14 UTC
Definitely.
I use PKGBUILD (Arch Linux), and each update is called 'git pull origin'.

Of course, all the changes were made...
Comment 20 Ray Strode [halfline] 2013-02-27 14:55:58 UTC
(reopening then)
Comment 21 Ray Strode [halfline] 2013-03-01 19:44:33 UTC
I found a machine that reproduces, will post patches soon.
Comment 22 Ray Strode [halfline] 2013-03-04 03:43:15 UTC
Created attachment 237923 [details] [review]
compositor: don't show stage right away

We don't want the stage shown until gnome-shell is ready for it.
This commit ensures the stage isn't shown implicitly.
Comment 23 Ray Strode [halfline] 2013-03-04 03:43:20 UTC
Created attachment 237924 [details] [review]
compositor: map overlay window before redirecting windows

When windows get redirected off screen, all that gets left behind
is black. We don't want to flicker black at startup, though.

This commit maps the overlay window early, before redirecting
toplevels, so they end up getting snapshotted onto the background
pixmap of the overlay window when the overlay window is mapped.
Comment 24 Ray Strode [halfline] 2013-03-04 03:43:36 UTC
Created attachment 237925 [details] [review]
main: don't explicitly hide the stage

It's hidden by default, so there's no point in hiding it explicitly.
Comment 25 Ray Strode [halfline] 2013-03-04 03:43:40 UTC
Created attachment 237926 [details] [review]
main: defer session update until after startup animation

We currently call the session updated handler as soon as
the session modes are read.  This handler sets up overview
keybindings (if a user session) and shows the login dialog
(if a gdm session).

We can't do the latter until the stage is mapped because it
takes a grab, but really we shouldn't do either until the
startup animation is finished.

This commit defers processing session updates until the
start up animation is finished.

It fixes a race condition at login screen startup now that
we don't show the stage right away.
Comment 26 Ray Strode [halfline] 2013-03-04 12:55:49 UTC
Review of attachment 237926 [details] [review]:

::: js/ui/main.js
@@ +197,3 @@
     layoutManager.connect('startup-prepared',
                           Lang.bind(this, function() {
                               layoutManager.startupAnimation();

Despite me saying in the commit message that this defers until the animation finishes, i'm actually just deferring until the animation starts. That's fine for this bug, but wrong for bug 694837 which I was hoping to fix as a side-effect.
Comment 27 Ray Strode [halfline] 2013-03-04 13:12:04 UTC
Created attachment 237977 [details] [review]
main: defer session update until startup animation

We currently call the session updated handler as soon as
the session modes are read.  This handler sets up keybindings
for leaving the overview (if a user session) and shows the
login dialog (if a gdm session).

We can't do the latter until the stage is mapped because it
takes a grab, and we don't need to do the former until the
user goes into the overview.

This commit defers processing session updates until the
the layout manager says start up is prepared.

It fixes a race condition at login screen startup now that
we don't show the stage right away.
Comment 28 Ray Strode [halfline] 2013-03-04 13:13:59 UTC
we'll have fix bug 694837 separately. My initial impression of _sessionUpdated was wrong, so i reattached the patch above with a more accurate commit message.
Comment 29 Jasper St. Pierre (not reading bugmail) 2013-03-04 19:24:25 UTC
Created attachment 238035 [details] [review]
main: Merge two different session-mode-updated handlers
Comment 30 Jasper St. Pierre (not reading bugmail) 2013-03-04 19:24:29 UTC
Created attachment 238036 [details] [review]
Defer initializing UI until after the global session has loaded
Comment 31 Ray Strode [halfline] 2013-03-04 19:54:50 UTC
Review of attachment 238035 [details] [review]:

sure.

::: js/ui/main.js
@@ +86,3 @@
         screenShield.showDialog();
+
+    _loadDefaultStylesheet();

So you start to fix this in the next patch, but a whole bunch of stuff that was getting called before screenShield.showDialog isn't getting called until after screenShield.showDialog now.

It's probably okay since at the end of the set you maintain behavior from before the set, but I'd either squash the two patches together or make a note that things are temporarily broken and will get corrected by the next commit.

@@ +113,3 @@
 function startSession() {
+    sessionMode.connect('updated', _sessionUpdated);
+    _sessionUpdated();

If you do go with the two-separate-commits route, i probably wouldn't move these lines in this commit. You're just going to move them again in the next commit, and it isn't right to call them this early given what sessionUpdated does, and moving them makes the git log -p output harder to read.
Comment 32 Ray Strode [halfline] 2013-03-04 19:59:22 UTC
Review of attachment 238036 [details] [review]:

a pretty nice clean up.

::: js/ui/main.js
@@ +84,3 @@
                                   sessionMode.hasRunDialog ? openRunDialog : null);
     if (sessionMode.isGreeter)
         screenShield.showDialog();

So we're still going to call screenShield.showDialog before we're ready. If we land this then we need to come up with a solution for that.
Comment 33 Ray Strode [halfline] 2013-03-04 20:00:39 UTC
feel free to push these if you want, but one of us will need to update attachment 237977 [details] [review] afterward.
Comment 34 drago01 2013-03-04 21:06:39 UTC
Review of attachment 237923 [details] [review]:

OK.
Comment 35 drago01 2013-03-04 21:07:35 UTC
Review of attachment 237924 [details] [review]:

OK.
Comment 36 drago01 2013-03-04 21:07:58 UTC
Review of attachment 237925 [details] [review]:

OK.
Comment 37 drago01 2013-03-04 21:11:56 UTC
Review of attachment 237977 [details] [review]:

If we do this we'd have to revert http://git.gnome.org/browse/gnome-shell/commit/?id=f644bee83195f7d094ed75e8d8e2b414be39cc96 otherwise the problem it fixed will be back because we don't have a stage at this point again.
Comment 38 Ray Strode [halfline] 2013-03-04 21:17:29 UTC
Attachment 237923 [details] pushed as 160150d - compositor: don't show stage right away
Attachment 237924 [details] pushed as e15bc37 - compositor: map overlay window before redirecting windows
Comment 39 Ray Strode [halfline] 2013-03-04 21:44:55 UTC
(In reply to comment #37)
> Review of attachment 237977 [details] [review]:
> 
> If we do this we'd have to revert
> http://git.gnome.org/browse/gnome-shell/commit/?id=f644bee83195f7d094ed75e8d8e2b414be39cc96
> otherwise the problem it fixed will be back because we don't have a stage at
> this point again.

talked with drago01 on irc about this.  The stage is getting realized by mutter in meta_compositor_manage_screen so I don't think we need to revert that commit. the function only sets some window properties on the stage window.

I did some dnd testing by dragging a url from firefox to the overview and the overview opened as expected.
Comment 40 Ray Strode [halfline] 2013-03-04 21:46:06 UTC
(leaving bug open since Jasper still has those clean ups in mind)

Attachment 237925 [details] pushed as 5e0ff7f - main: don't explicitly hide the stage
Attachment 237977 [details] pushed as 260c082 - main: defer session update until startup animation
Comment 41 Jasper St. Pierre (not reading bugmail) 2013-03-05 05:31:44 UTC
Created attachment 238084 [details] [review]
main: Merge two different session-mode-updated handlers
Comment 42 Jasper St. Pierre (not reading bugmail) 2013-03-05 05:34:32 UTC
Created attachment 238085 [details] [review]
Defer initializing UI until after the global session has loaded
Comment 43 Ray Strode [halfline] 2013-03-06 19:26:37 UTC
Review of attachment 238084 [details] [review]:

sure
Comment 44 Ray Strode [halfline] 2013-03-06 19:27:20 UTC
Review of attachment 238085 [details] [review]:

looks fine except for one nit

::: js/ui/main.js
@@ +116,3 @@
+    // Make sure the default stylesheet is loaded when we
+    // construct the UI.
+    _loadDefaultStylesheet();

This is already called a few lines lower in the function
Comment 45 Jasper St. Pierre (not reading bugmail) 2013-03-06 19:35:24 UTC
Comment on attachment 238084 [details] [review]
main: Merge two different session-mode-updated handlers

Attachment 238084 [details] pushed as 0ba1f29 - main: Merge two different session-mode-updated handlers
Comment 46 Jasper St. Pierre (not reading bugmail) 2013-03-06 19:35:37 UTC
Created attachment 238235 [details] [review]
Defer initializing UI until after the global session has loaded
Comment 47 Ray Strode [halfline] 2013-03-06 19:42:32 UTC
Review of attachment 238235 [details] [review]:

++
Comment 48 Jasper St. Pierre (not reading bugmail) 2013-03-06 19:56:15 UTC
Attachment 238235 [details] pushed as 0bef925 - Defer initializing UI until after the global session has loaded
Comment 50 Jasper St. Pierre (not reading bugmail) 2013-03-06 23:48:52 UTC
Created attachment 238260 [details] [review]
main: Remove leftover hunk connection to sessionUpdated

We shouldn't connect to sessionUpdated twice.
Comment 51 Jasper St. Pierre (not reading bugmail) 2013-03-06 23:48:55 UTC
Created attachment 238261 [details] [review]
layout: Move showing the stage and the startup-prepared signal

Waiting until we're idle means nothing if we're constructing
complex actors.
Comment 52 Jasper St. Pierre (not reading bugmail) 2013-03-06 23:49:00 UTC
Created attachment 238262 [details] [review]
main: Show the greeter dialog when we're prepared

If we don't wait until the stage is mapped, pushing a modal
will fail with an X error.
Comment 53 Ray Strode [halfline] 2013-03-07 15:04:52 UTC
Review of attachment 238261 [details] [review]:

seems okay.

::: js/ui/layout.js
@@ +604,3 @@
     },
 
+    _startupAnimation: function() {

I like that you're making this private, but for symmetry maybe prepareStartupAnimation should be private too.
Comment 54 Ray Strode [halfline] 2013-03-07 15:09:39 UTC
Review of attachment 238262 [details] [review]:

yup, this should do the trick i think.
Comment 55 Jasper St. Pierre (not reading bugmail) 2013-03-07 21:50:39 UTC
Attachment 238260 [details] pushed as de2f2d7 - main: Remove leftover hunk connection to sessionUpdated
Attachment 238261 [details] pushed as e2463cb - layout: Move showing the stage and the startup-prepared signal
Attachment 238262 [details] pushed as 65067c2 - main: Show the greeter dialog when we're prepared
Comment 56 Florian Müllner 2013-03-08 20:19:37 UTC
... and more breakage, reopening.
Comment 57 Florian Müllner 2013-03-08 20:20:28 UTC
Created attachment 238398 [details] [review]
main: Do not export DBus interfaces before initializing the UI

Since commit 7cdb75e7ce76, initializing UI is deferred until the session
mode has been loaded. However DBus is still initialized immediately,
which means that for DBus methods that access properties in Main, there
is now a window between the method being exposed on the bus and the
method being ready to be called. At least g-s-d grabbing global keybindings
is likely to fall in this window on session startup, and almost guaranteed
when regrabbing bindings after a shell restart.
To fix, defer initializing DBus as well.
Comment 58 Jasper St. Pierre (not reading bugmail) 2013-03-08 20:28:26 UTC
DBus on startup is still broken -- we grab the bus names, but don't export methods on them.
Comment 59 Florian Müllner 2013-03-08 20:32:31 UTC
Yes, and g-s-d has a workaround for that. It's unfortunate, but not an excuse for breaking it even more.
Comment 60 Giovanni Campagna 2013-03-08 22:07:01 UTC
But the reason to grab the bus names early ceased to exists: gnome-session doesn't watch on bus names, it uses the XDCMP registration and direct PID watching to monitor us. So can't we move the ShellGlobal code to register names later in the startup sequence (or move it to JS entirely)?
Comment 61 Florian Müllner 2013-03-08 22:31:10 UTC
(In reply to comment #60)
> So can't we move the ShellGlobal code to register names later in the 
> startup sequence (or move it to JS entirely)?

Probably, but it's really a secondary question here - even if we only grab the name when initializing ShellDBus, any method that uses stuff from Main will still be broken until _initializeUI() has been called.

Alternatively we could revert all patches following comment #40.
Comment 62 Giovanni Campagna 2013-03-08 23:06:42 UTC
Yeah, of course, I didn't mean to replace your last patch, but to augment it, by moving the bus name grabbing to happen after we register objects.
Btw, if we only ever get the name after startup, we can init ShellDBus at any time, nobody will call it anyway.
Comment 63 Florian Müllner 2013-03-14 16:20:17 UTC
Ping? This needs to be fixed before 3.7.92 ...
Comment 64 Jasper St. Pierre (not reading bugmail) 2013-03-14 16:24:14 UTC
Review of attachment 238398 [details] [review]:

OK.
Comment 65 Florian Müllner 2013-03-14 16:28:55 UTC
Attachment 238398 [details] pushed as ec014a7 - main: Do not export DBus interfaces before initializing the UI