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 664009 - Keeps showing “busy” cursor
Keeps showing “busy” cursor
Status: RESOLVED OBSOLETE
Product: gdm
Classification: Core
Component: general
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-11-14 08:07 UTC by Joachim Breitner
Modified: 2018-02-12 14:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
debug log (117.14 KB, text/plain)
2011-11-14 08:07 UTC, Joachim Breitner
  Details
GDM Log of an auto-login session (31.58 KB, application/octet-stream)
2011-11-14 20:59 UTC, Joachim Breitner
  Details
Simple fix (767 bytes, patch)
2011-11-14 21:00 UTC, Joachim Breitner
none Details | Review

Description Joachim Breitner 2011-11-14 08:07:39 UTC
Created attachment 201348 [details]
debug log

Hi,

I’m running gnome-session with a custom session (basically fallback + xmonad). Often, but not always, even after the session has been full bought up, the mouse pointer is still the “busy” cursor over the panel and the desktop. Stuff works fine, but it is quite unnerving.

I have attached a xsession-errors file with --debug enabled.

Thanks,
Joachim
Comment 1 Joachim Breitner 2011-11-14 08:07:54 UTC
Oh, forgot: Version is 3.0.2 on Debian.
Comment 2 Vincent Untz 2011-11-14 11:17:56 UTC
Could you possibly hack the session a bit to remove some components, so we know which one is creating this? I doubt this is gnome-session (I don't think gnome-session changes the cursor anymore).
Comment 3 Joachim Breitner 2011-11-14 14:50:49 UTC
Thanks for the hint about gnome-session not touching the cursor, a quick log-out and log-in, which fixed the problem, indicates that this has to do with gdm3 autologin, i.e. gdm3 setting the busy wait cursor, but not removing it unless the greeter has been shown.

It is still the question whether this is intentional, and gnome-session should reset the cursor, or whether gdm should clean up.

(I yet have to verify this using some plain xterm session or something, but right now.)
Comment 4 Joachim Breitner 2011-11-14 20:51:43 UTC
Indeed, if I use gdm3 auto-login into a plain “xterm” session, I get the GDK_BUSY cursor. If I start the session directly with "startx xterm", I don’t. So it seems that gdm3 is somehow the culprit. I’m attaching a gdm debug log.

But:
$ fgrep -r GDK_WATCH . 
./utils/gdm-screenshot.c:        cursor = gdk_cursor_new (GDK_WATCH);
./gui/simple-greeter/gdm-language-chooser-dialog.c:        cursor =  gdk_cursor_new (GDK_WATCH);
./gui/simple-greeter/gdm-greeter-login-window.c:        cursor = gdk_cursor_new (GDK_WATCH);

and with auto-login, according to the log file, neither greeter nor chooser get started. What else could be setting the cursor?

Ah, I think I found the code, in ./daemon/gdm-simple-slave.c:
static void
setup_server (GdmSimpleSlave *slave)
{
        /* Put cursor out of the way on first head */
        gdm_slave_set_initial_cursor_position (GDM_SLAVE (slave));

        /* Set the busy cursor */
        gdm_slave_set_busy_cursor (GDM_SLAVE (slave));
}

This is called in idle_connect_to_display in:
                setup_server (slave);

                delay = 0;
                enabled = FALSE;
                gdm_slave_get_timed_login_details (GDM_SLAVE (slave), &enabled, NULL, &delay);
                if (! enabled || delay > 0) {
                        start_greeter (slave);
                        create_new_session (slave);
                } else {
                        /* Run the init script. gdmslave suspends until script has terminated */
                        gdm_slave_run_script (GDM_SLAVE (slave), GDMCONFDIR "/Init", GDM_USERNAME);
                        reset_session (slave);
                }

So maybe  setup_server needs to be moved before start_greeter. Alternatively, (since setup_server also positions the mouse), the cursor should be re-set before running the /Init script.

I’ll testt the “easy” solution now...
Comment 5 Joachim Breitner 2011-11-14 20:59:39 UTC
Created attachment 201400 [details]
GDM Log of an auto-login session
Comment 6 Joachim Breitner 2011-11-14 21:00:06 UTC
Created attachment 201401 [details] [review]
Simple fix
Comment 7 Joachim Breitner 2011-11-14 21:02:39 UTC
Indeed, that is the problem. The simple slave sets the cursor to WAIT, which is fine if it is followed by the greeter, which will reset the cursor. But if auto-login is used, then this does not happen.

The attached fix avoids setting the cursor if the auto-login route is taken, but leaves the cursor in the middle of the screen. Better fixes would be 
 * Splitting setup_server to always position the cursor, but not set it to WAIT if auto-login is done in idle_connect_to_display().
 * Identifying the right spot in the auto-login patch to reset the cursor.

The fact that the slave class provides gdm_slave_set_busy_cursor(), but no gdm_slave_reset_cursor() indicates some mismatch here.

In any case, this should be reassigned to gdm3.
Comment 8 Joachim Breitner 2011-11-14 21:06:21 UTC
Hmm, I just noticed that now I get the 80ies X cursor instead. So I guess the proper solution is to set the reset the curser somewhere in static-salve the same way as it wold be done in the greeter.
Comment 9 Joachim Breitner 2011-11-14 22:59:25 UTC
Another note: If a session is started from scratch (e.g. via startx) it is expected to set the cursor anyways, as otherwise the X cursor would stay. By that argument, one could claim that gdm has every right to leave the cursor in some undefined condition, including GDK_WAIT. If you follow that line of argument feel to close the bug.

I have fixed it for my situation (a window manager that does not set the root cursor) using
echo xsetroot -xcf /usr/share/icons/Adwaita/cursors/left_ptr 16 >> .gnomerc

It seems that metacity would set the cursor anyways (not tested, but grep’ed through the source code), so the regular gnome fallback session is not affected by this bug.
Comment 10 Ray Strode [halfline] 2012-09-05 02:10:59 UTC
Thanks for the investigative work on this bug.  I think the logic in comment 9 is probably right.  As it stands, we really want autologin to set a busy cursor and have the window manager set it to a non-busy cursor, since it's appropriate to have a busy cursor while things are loading.

Though, see bug 652066 for some discussion about alternates to cursors for busy notification.
Comment 11 Joachim Breitner 2012-09-05 07:07:16 UTC
Thanks for responding, I agree that it makes sense to expect the WM to set the cursor. But in that case, shouldn’t gdm set the cursor back to busy even after a non-auto-login, so that it behaves consistently?
Comment 12 Ray Strode [halfline] 2012-09-06 18:41:58 UTC
indeed.