|
|
e0b6b0 |
From a1c74e2e42dea464ab0b439b767da5c12cbf3986 Mon Sep 17 00:00:00 2001
|
|
|
c90517 |
From: Ray Strode <rstrode@redhat.com>
|
|
|
c90517 |
Date: Thu, 11 Oct 2018 07:15:56 -0400
|
|
|
e0b6b0 |
Subject: [PATCH 47/51] local-display-factory: kill X on login just like
|
|
|
c90517 |
wayland
|
|
|
c90517 |
|
|
|
c90517 |
These days we kill the wayland login screen during login to
|
|
|
c90517 |
conserve system resources.
|
|
|
c90517 |
|
|
|
c90517 |
We've been reluctant to do the same for X based login screens,
|
|
|
c90517 |
because X didn't handle being killed in the background so well.
|
|
|
c90517 |
|
|
|
c90517 |
This is no longer a problem, since this commit:
|
|
|
c90517 |
|
|
|
c90517 |
https://gitlab.freedesktop.org/xorg/xserver/-/commit/ff91c696ff8f5f56da40e107cb5c321539758a81
|
|
|
c90517 |
|
|
|
c90517 |
So let's go ahead and kill it now.
|
|
|
c90517 |
---
|
|
|
c90517 |
daemon/gdm-local-display-factory.c | 9 ---------
|
|
|
c90517 |
1 file changed, 9 deletions(-)
|
|
|
c90517 |
|
|
|
c90517 |
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
|
|
|
c90517 |
index a288f8765..aae226750 100644
|
|
|
c90517 |
--- a/daemon/gdm-local-display-factory.c
|
|
|
c90517 |
+++ b/daemon/gdm-local-display-factory.c
|
|
|
c90517 |
@@ -599,86 +599,77 @@ on_seat_removed (GDBusConnection *connection,
|
|
|
c90517 |
|
|
|
c90517 |
g_variant_get (parameters, "(&s&o)", &seat, NULL);
|
|
|
c90517 |
delete_display (GDM_LOCAL_DISPLAY_FACTORY (user_data), seat);
|
|
|
c90517 |
}
|
|
|
c90517 |
|
|
|
c90517 |
#if defined(ENABLE_WAYLAND_SUPPORT) && defined(ENABLE_USER_DISPLAY_SERVER)
|
|
|
c90517 |
static gboolean
|
|
|
c90517 |
lookup_by_session_id (const char *id,
|
|
|
c90517 |
GdmDisplay *display,
|
|
|
c90517 |
gpointer user_data)
|
|
|
c90517 |
{
|
|
|
c90517 |
const char *looking_for = user_data;
|
|
|
c90517 |
const char *current;
|
|
|
c90517 |
|
|
|
c90517 |
current = gdm_display_get_session_id (display);
|
|
|
c90517 |
return g_strcmp0 (current, looking_for) == 0;
|
|
|
c90517 |
}
|
|
|
c90517 |
|
|
|
c90517 |
static gboolean
|
|
|
c90517 |
wait_to_finish_timeout (GdmLocalDisplayFactory *factory)
|
|
|
c90517 |
{
|
|
|
c90517 |
finish_waiting_displays_on_seat (factory, "seat0");
|
|
|
c90517 |
factory->priv->wait_to_finish_timeout_id = 0;
|
|
|
c90517 |
return G_SOURCE_REMOVE;
|
|
|
c90517 |
}
|
|
|
c90517 |
|
|
|
c90517 |
static void
|
|
|
c90517 |
maybe_stop_greeter_in_background (GdmLocalDisplayFactory *factory,
|
|
|
c90517 |
GdmDisplay *display)
|
|
|
c90517 |
{
|
|
|
c90517 |
- g_autofree char *display_session_type = NULL;
|
|
|
c90517 |
gboolean doing_initial_setup = FALSE;
|
|
|
c90517 |
|
|
|
c90517 |
if (gdm_display_get_status (display) != GDM_DISPLAY_MANAGED) {
|
|
|
c90517 |
g_debug ("GdmLocalDisplayFactory: login window not in managed state, so ignoring");
|
|
|
c90517 |
return;
|
|
|
c90517 |
}
|
|
|
c90517 |
|
|
|
c90517 |
g_object_get (G_OBJECT (display),
|
|
|
c90517 |
- "session-type", &display_session_type,
|
|
|
c90517 |
"doing-initial-setup", &doing_initial_setup,
|
|
|
c90517 |
NULL);
|
|
|
c90517 |
|
|
|
c90517 |
/* we don't ever stop initial-setup implicitly */
|
|
|
c90517 |
if (doing_initial_setup) {
|
|
|
c90517 |
g_debug ("GdmLocalDisplayFactory: login window is performing initial-setup, so ignoring");
|
|
|
c90517 |
return;
|
|
|
c90517 |
}
|
|
|
c90517 |
|
|
|
c90517 |
- /* we can only stop greeter for wayland sessions, since
|
|
|
c90517 |
- * X server would jump back on exit */
|
|
|
c90517 |
- if (g_strcmp0 (display_session_type, "wayland") != 0) {
|
|
|
c90517 |
- g_debug ("GdmLocalDisplayFactory: login window is running on Xorg, so ignoring");
|
|
|
c90517 |
- return;
|
|
|
c90517 |
- }
|
|
|
c90517 |
-
|
|
|
c90517 |
g_debug ("GdmLocalDisplayFactory: killing login window once its unused");
|
|
|
c90517 |
g_object_set (G_OBJECT (display), "status", GDM_DISPLAY_WAITING_TO_FINISH, NULL);
|
|
|
c90517 |
|
|
|
c90517 |
/* We stop the greeter after a timeout to avoid flicker */
|
|
|
c90517 |
if (factory->priv->wait_to_finish_timeout_id != 0)
|
|
|
c90517 |
g_source_remove (factory->priv->wait_to_finish_timeout_id);
|
|
|
c90517 |
|
|
|
c90517 |
factory->priv->wait_to_finish_timeout_id =
|
|
|
c90517 |
g_timeout_add_seconds (WAIT_TO_FINISH_TIMEOUT,
|
|
|
c90517 |
(GSourceFunc)wait_to_finish_timeout,
|
|
|
c90517 |
factory);
|
|
|
c90517 |
}
|
|
|
c90517 |
|
|
|
c90517 |
static gboolean
|
|
|
c90517 |
on_vt_changed (GIOChannel *source,
|
|
|
c90517 |
GIOCondition condition,
|
|
|
c90517 |
GdmLocalDisplayFactory *factory)
|
|
|
c90517 |
{
|
|
|
c90517 |
GIOStatus status;
|
|
|
c90517 |
g_autofree char *tty_of_active_vt = NULL;
|
|
|
c90517 |
g_autofree char *login_session_id = NULL;
|
|
|
c90517 |
g_autofree char *active_session_id = NULL;
|
|
|
c90517 |
unsigned int previous_vt, new_vt;
|
|
|
c90517 |
const char *session_type = NULL;
|
|
|
c90517 |
int ret, n_returned;
|
|
|
c90517 |
|
|
|
c90517 |
g_debug ("GdmLocalDisplayFactory: received VT change event");
|
|
|
c90517 |
g_io_channel_seek_position (source, 0, G_SEEK_SET, NULL);
|
|
|
c90517 |
|
|
|
c90517 |
if (condition & G_IO_PRI) {
|
|
|
c90517 |
--
|
|
|
e0b6b0 |
2.27.0
|
|
|
c90517 |
|