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 570615 - wait less time for X ...
wait less time for X ...
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
2.24.x
Other Linux
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2009-02-05 11:29 UTC by Michael Meeks
Modified: 2009-07-17 02:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (6.80 KB, patch)
2009-02-05 11:29 UTC, Michael Meeks
reviewed Details | Review

Description Michael Meeks 2009-02-05 11:29:18 UTC
So - most likely this breaks some setups; and I guess it would be nice to have some more central fall-back / growing interval timer instead of this [ a linear ramp would prolly do it nicely ].

I also merge the two (rather similar) idle_connect_for_display things and move them into the gdm-slave module - even though (it seems) they were moved out of there a while back [ judging from the left-over, unsused MAX_CONNECTIONS thingit ].

Anyhow, comments much appreciated, and I'll try to clean it up - this saves ~450ms on boot with autologin for me.

HTH,

    Michael.
Comment 1 Michael Meeks 2009-02-05 11:29:59 UTC
Created attachment 127998 [details] [review]
patch
Comment 2 Ray Strode [halfline] 2009-07-17 02:43:58 UTC
So looking at this...

There are two places we call idle_connect_to_display:

a) If the display is local
b) If the display is remote

Case a) is the normal case that you're hitting with autologin.  We actually do...

1. Start X server in a special way to have it tell us when it's ready
2. Wait for it to tell us it's ready
3. Queue a timeout to connect to it a half second later

3. is dumb.  It told us it's ready.  It's not lying to us.  We should just connect right away, not 500ms later, not 50ms later.
Comment 3 Ray Strode [halfline] 2009-07-17 02:49:04 UTC
I ended up committing this smaller patch:

commit 2ca2209c18b6659c8282039732bb62436779db55
Author: Ray Strode <rstrode@redhat.com>
Date:   Thu Jul 16 22:47:53 2009 -0400

    Don't wait 1/2sec before connecting to display
    
    It told us it's ready so let's not waste time.
    
    See bug http://bugzilla.gnome.org/show_bug.cgi?id=570615

diff --git a/daemon/gdm-simple-slave.c b/daemon/gdm-simple-slave.c
index 948886f..72efdfd 100644
--- a/daemon/gdm-simple-slave.c
+++ b/daemon/gdm-simple-slave.c
@@ -1033,7 +1033,7 @@ static void
 on_server_ready (GdmServer      *server,
                  GdmSimpleSlave *slave)
 {
-        g_timeout_add (500, (GSourceFunc)idle_connect_to_display, slave);
+        g_idle_add ((GSourceFunc)idle_connect_to_display, slave);
 }
 
 static void