diff options
author | Ray Strode <rstrode@redhat.com> | 2018-08-30 16:09:02 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2018-08-31 16:56:41 -0400 |
commit | 708618746683ea086068e2498fd1c69917c6189a (patch) | |
tree | bcb8f2d549ffbedfcc0aa4517fb6ea6dc3c106b6 /daemon/gdm-x-session.c | |
parent | 9f7fc717c3b71ed1d29d8bc3f52de86a3cc0a040 (diff) | |
download | gdm-708618746683ea086068e2498fd1c69917c6189a.tar.gz |
gdm-wayland-session,gdm-x-session: register after delay
Right now gdm-x-session registers with GDM as soon as the
X server is started, and gdm-wayland-session registers as
soon as the session is started.
Ideally registration wouldn't happen until the session
says things started successfully.
This commit inches us toward that ideal but adding a little
timeout before proceeding with registration.
A future commit will add a new xsession file key to allow
us to know whether or not the session manager of the session
supports doing registration.
Diffstat (limited to 'daemon/gdm-x-session.c')
-rw-r--r-- | daemon/gdm-x-session.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/daemon/gdm-x-session.c b/daemon/gdm-x-session.c index 3b2fcef4..412999cf 100644 --- a/daemon/gdm-x-session.c +++ b/daemon/gdm-x-session.c @@ -810,6 +810,21 @@ on_sigterm (State *state) return G_SOURCE_CONTINUE; } +static gboolean +on_registration_delay_complete (State *state) +{ + gboolean ret; + + ret = register_display (state, state->cancellable); + + if (!ret) { + g_printerr ("Unable to register display with display manager\n"); + g_main_loop_quit (state->main_loop); + } + + return G_SOURCE_REMOVE; +} + int main (int argc, char **argv) @@ -896,14 +911,6 @@ main (int argc, goto out; } - ret = register_display (state, state->cancellable); - - if (!ret) { - g_printerr ("Unable to register display with display manager\n"); - exit_status = EX_SOFTWARE; - goto out; - } - ret = spawn_session (state, run_script, state->cancellable); if (!ret) { @@ -912,6 +919,8 @@ main (int argc, goto out; } + g_timeout_add_seconds (2, (GSourceFunc) on_registration_delay_complete, state); + g_main_loop_run (state->main_loop); /* Only use exit status of session if we're here because it exit */ |