Allow adding custom parameters to Xorg
Resolves: RHEL-81194
This commit is contained in:
parent
23d589cff2
commit
05a5d6db39
136
0001-gdm-x-session-Allow-adding-custom-arguments-to-Xorg.patch
Normal file
136
0001-gdm-x-session-Allow-adding-custom-arguments-to-Xorg.patch
Normal file
@ -0,0 +1,136 @@
|
||||
From e879ecad55b43157122b782039881f7264236f98 Mon Sep 17 00:00:00 2001
|
||||
From: Joan Torres Lopez <joantolo@redhat.com>
|
||||
Date: Wed, 16 Jul 2025 16:11:22 +0200
|
||||
Subject: [PATCH] gdm-x-session: Allow adding custom arguments to Xorg
|
||||
|
||||
Use Command option in xorg section in custom.conf to add custom arguments
|
||||
to Xorg.
|
||||
---
|
||||
common/gdm-settings-keys.h | 2 ++
|
||||
daemon/gdm-session.c | 13 +++++++++++--
|
||||
daemon/gdm-x-session.c | 10 +++++++++-
|
||||
data/gdm.schemas.in | 6 ++++++
|
||||
4 files changed, 28 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/common/gdm-settings-keys.h b/common/gdm-settings-keys.h
|
||||
index 4b3a1ff..ce875eb 100644
|
||||
--- a/common/gdm-settings-keys.h
|
||||
+++ b/common/gdm-settings-keys.h
|
||||
@@ -59,6 +59,8 @@ G_BEGIN_DECLS
|
||||
#define GDM_KEY_WILLING "xdmcp/Willing"
|
||||
#define GDM_KEY_ALLOW_MULTIPLE_SESSIONS_PER_USER "xdmcp/AllowMultipleSessionsPerUser"
|
||||
|
||||
+#define GDM_KEY_XORG_COMMAND "xorg/Command"
|
||||
+
|
||||
#define GDM_KEY_MULTICAST "chooser/Multicast"
|
||||
#define GDM_KEY_MULTICAST_ADDR "chooser/MulticastAddr"
|
||||
|
||||
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
||||
index e6febeb..77e8023 100644
|
||||
--- a/daemon/gdm-session.c
|
||||
+++ b/daemon/gdm-session.c
|
||||
@@ -2945,6 +2945,8 @@ gdm_session_start_session (GdmSession *self,
|
||||
char *command;
|
||||
char *program;
|
||||
gboolean register_session;
|
||||
+ g_autofree char *xorg_option = NULL;
|
||||
+ g_autofree char *xorg_command = NULL;
|
||||
|
||||
g_return_if_fail (GDM_IS_SESSION (self));
|
||||
g_return_if_fail (self->session_conversation == NULL);
|
||||
@@ -2991,12 +2993,18 @@ gdm_session_start_session (GdmSession *self,
|
||||
allow_remote_connections = TRUE;
|
||||
}
|
||||
|
||||
+ gdm_settings_direct_get_string (GDM_KEY_XORG_COMMAND, &xorg_option);
|
||||
+ if (xorg_option != NULL && *xorg_option != '\0') {
|
||||
+ xorg_command = g_strdup_printf ("--xorg-command \"%s\" ", xorg_option);
|
||||
+ }
|
||||
+
|
||||
if (run_launcher) {
|
||||
if (is_x11) {
|
||||
- program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s%s %s\"%s\"",
|
||||
+ program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s%s%s%s\"%s\"",
|
||||
register_session ? "--register-session " : "",
|
||||
run_xsession_script? "--run-script " : "",
|
||||
allow_remote_connections? "--allow-remote-connections " : "",
|
||||
+ xorg_command? xorg_command : "",
|
||||
command);
|
||||
} else {
|
||||
program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"%s\"",
|
||||
@@ -3031,8 +3039,9 @@ gdm_session_start_session (GdmSession *self,
|
||||
*/
|
||||
if (run_launcher) {
|
||||
if (is_x11) {
|
||||
- program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s\"dbus-run-session -- %s\"",
|
||||
+ program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s%s\"dbus-run-session -- %s\"",
|
||||
register_session ? "--register-session " : "",
|
||||
+ xorg_command? xorg_command : "",
|
||||
self->selected_program);
|
||||
} else {
|
||||
program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"dbus-run-session -- %s\"",
|
||||
diff --git a/daemon/gdm-x-session.c b/daemon/gdm-x-session.c
|
||||
index 0b07ab5..5e25d77 100644
|
||||
--- a/daemon/gdm-x-session.c
|
||||
+++ b/daemon/gdm-x-session.c
|
||||
@@ -197,6 +197,7 @@ out:
|
||||
static gboolean
|
||||
spawn_x_server (State *state,
|
||||
gboolean allow_remote_connections,
|
||||
+ const char *xorg_command,
|
||||
GCancellable *cancellable)
|
||||
{
|
||||
GPtrArray *arguments = NULL;
|
||||
@@ -289,6 +290,11 @@ spawn_x_server (State *state,
|
||||
if (state->debug_enabled) {
|
||||
g_ptr_array_add (arguments, "-core");
|
||||
}
|
||||
+
|
||||
+ if (xorg_command != NULL && *xorg_command != '\0') {
|
||||
+ g_ptr_array_add (arguments, (void *)xorg_command);
|
||||
+ }
|
||||
+
|
||||
g_ptr_array_add (arguments, NULL);
|
||||
|
||||
subprocess = g_subprocess_launcher_spawnv (launcher,
|
||||
@@ -874,11 +880,13 @@ main (int argc,
|
||||
gboolean ret;
|
||||
int exit_status = EX_OK;
|
||||
static gboolean register_session = FALSE;
|
||||
+ static const char *xorg_command = NULL;
|
||||
|
||||
static GOptionEntry entries [] = {
|
||||
{ "run-script", 'r', 0, G_OPTION_ARG_NONE, &run_script, N_("Run program through /etc/gdm/Xsession wrapper script"), NULL },
|
||||
{ "allow-remote-connections", 'a', 0, G_OPTION_ARG_NONE, &allow_remote_connections, N_("Listen on TCP socket"), NULL },
|
||||
{ "register-session", 0, 0, G_OPTION_ARG_NONE, ®ister_session, "Register session after a delay", NULL },
|
||||
+ { "xorg-command", 0, 0, G_OPTION_ARG_STRING, &xorg_command, "Add extra arguments to Xorg command", NULL },
|
||||
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &args, "", "" },
|
||||
{ NULL }
|
||||
};
|
||||
@@ -924,7 +932,7 @@ main (int argc,
|
||||
|
||||
g_unix_signal_add (SIGTERM, (GSourceFunc) on_sigterm, state);
|
||||
|
||||
- ret = spawn_x_server (state, allow_remote_connections, state->cancellable);
|
||||
+ ret = spawn_x_server (state, allow_remote_connections, xorg_command, state->cancellable);
|
||||
|
||||
if (!ret) {
|
||||
g_printerr ("Unable to run X server\n");
|
||||
diff --git a/data/gdm.schemas.in b/data/gdm.schemas.in
|
||||
index 929d13d..b862887 100644
|
||||
--- a/data/gdm.schemas.in
|
||||
+++ b/data/gdm.schemas.in
|
||||
@@ -144,6 +144,12 @@
|
||||
<signature>b</signature>
|
||||
<default>false</default>
|
||||
</schema>
|
||||
+
|
||||
+ <schema>
|
||||
+ <key>xorg/Command</key>
|
||||
+ <signature>s</signature>
|
||||
+ <default></default>
|
||||
+ </schema>
|
||||
</schemalist>
|
||||
</gdmschemafile>
|
||||
|
||||
2.49.0
|
||||
7
gdm.spec
7
gdm.spec
@ -11,7 +11,7 @@
|
||||
Name: gdm
|
||||
Epoch: 1
|
||||
Version: 40.1
|
||||
Release: 33%{?dist}
|
||||
Release: 34%{?dist}
|
||||
Summary: The GNOME Display Manager
|
||||
|
||||
License: GPLv2+
|
||||
@ -83,6 +83,7 @@ Patch99930001: 0001-data-add-system-dconf-databases-to-gdm-profile.patch
|
||||
|
||||
Patch99950001: 0001-data-Disable-network-configuration-on-login-screen.patch
|
||||
|
||||
Patch99960001: 0001-gdm-x-session-Allow-adding-custom-arguments-to-Xorg.patch
|
||||
|
||||
BuildRequires: accountsservice-devel
|
||||
BuildRequires: audit-libs-devel >= %{libauditver}
|
||||
@ -372,6 +373,10 @@ dconf update || :
|
||||
%{_libdir}/pkgconfig/gdm-pam-extensions.pc
|
||||
|
||||
%changelog
|
||||
* Mon Jul 14 2025 Joan Torres <joantolo@redhat.com> - 40.1-34
|
||||
- Allow adding custom parameters to Xorg
|
||||
Resolves: RHEL-81194
|
||||
|
||||
* Fri Jun 20 2025 Joan Torres <joantolo@redhat.com> - 40.1-33
|
||||
- Fix leak on new connections
|
||||
Resolves: RHEL-98562
|
||||
|
||||
Loading…
Reference in New Issue
Block a user