From e9c8cb8f3ffb9ebf12ee0119e03aacc804164d3e Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 7 Nov 2025 19:34:06 +0100 Subject: [PATCH] os: unexport SeatId and move it to dix settings Not used by any external module/driver, so no need to keep it public. Also move it to the new dix settings code and rename it. Signed-off-by: Enrico Weigelt, metux IT consult --- config/hotplug_priv.h | 4 +++- config/udev.c | 11 ++++++----- dix/settings.c | 2 ++ dix/settings_priv.h | 1 + hw/kdrive/ephyr/ephyrinit.c | 3 ++- hw/kdrive/src/kdrive.c | 6 +++--- hw/kdrive/src/kinput.c | 9 +++++---- hw/xfree86/common/xf86Config.c | 2 +- hw/xfree86/common/xf86Init.c | 4 ++-- include/globals.h | 2 -- os/utils.c | 6 ++---- 11 files changed, 27 insertions(+), 23 deletions(-) diff --git a/config/hotplug_priv.h b/config/hotplug_priv.h index 2aebba3dd..50916e050 100644 --- a/config/hotplug_priv.h +++ b/config/hotplug_priv.h @@ -31,6 +31,8 @@ #include +#include "dix/settings_priv.h" + #include "list.h" /* Bump this each time you add something to the struct @@ -76,7 +78,7 @@ void NewGPUDeviceRequest(struct OdevAttributes *attribs); void DeleteGPUDeviceRequest(struct OdevAttributes *attribs); #endif -#define ServerIsNotSeat0() (SeatId && strcmp(SeatId, "seat0")) +#define ServerIsNotSeat0() (dixSettingSeatId && strcmp(dixSettingSeatId, "seat0")) struct xf86_platform_device * xf86_find_platform_device_by_devnum(unsigned int major, unsigned int minor); diff --git a/config/udev.c b/config/udev.c index 3c89d178c..144b905e5 100644 --- a/config/udev.c +++ b/config/udev.c @@ -29,6 +29,7 @@ #include #include +#include "dix/settings_priv.h" #include "config/hotplug_priv.h" #include "os/fmt.h" @@ -75,10 +76,10 @@ check_seat(struct udev_device *udev_device) if (!dev_seat) dev_seat = "seat0"; - if (SeatId && strcmp(dev_seat, SeatId)) + if (dixSettingSeatId && strcmp(dev_seat, dixSettingSeatId)) return FALSE; - if (!SeatId && strcmp(dev_seat, "seat0")) + if (!dixSettingSeatId && strcmp(dev_seat, "seat0")) return FALSE; return TRUE; @@ -406,7 +407,7 @@ config_udev_pre_init(void) #ifdef HAVE_UDEV_MONITOR_FILTER_ADD_MATCH_TAG if (ServerIsNotSeat0()) - udev_monitor_filter_add_match_tag(udev_monitor, SeatId); + udev_monitor_filter_add_match_tag(udev_monitor, dixSettingSeatId); #endif if (udev_monitor_enable_receiving(udev_monitor)) { ErrorF("config/udev: failed to bind the udev monitor\n"); @@ -435,7 +436,7 @@ config_udev_init(void) #ifdef HAVE_UDEV_ENUMERATE_ADD_MATCH_TAG if (ServerIsNotSeat0()) - udev_enumerate_add_match_tag(enumerate, SeatId); + udev_enumerate_add_match_tag(enumerate, dixSettingSeatId); #endif udev_enumerate_scan_devices(enumerate); @@ -580,7 +581,7 @@ config_udev_odev_probe(config_odev_probe_proc_ptr probe_callback) udev_enumerate_add_match_sysname(enumerate, "card[0-9]*"); #ifdef HAVE_UDEV_ENUMERATE_ADD_MATCH_TAG if (ServerIsNotSeat0()) - udev_enumerate_add_match_tag(enumerate, SeatId); + udev_enumerate_add_match_tag(enumerate, dixSettingSeatId); #endif udev_enumerate_scan_devices(enumerate); devices = udev_enumerate_get_list_entry(enumerate); diff --git a/dix/settings.c b/dix/settings.c index 4c36e8e3b..cf8ab7fad 100644 --- a/dix/settings.c +++ b/dix/settings.c @@ -11,7 +11,9 @@ #include #include +#include #include "dix/settings_priv.h" bool dixSettingAllowByteSwappedClients = false; +char *dixSettingSeatId = NULL; diff --git a/dix/settings_priv.h b/dix/settings_priv.h index 4fe49bce2..efee9cc9c 100644 --- a/dix/settings_priv.h +++ b/dix/settings_priv.h @@ -15,5 +15,6 @@ */ extern bool dixSettingAllowByteSwappedClients; +extern char *dixSettingSeatId; #endif diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c index da78680d9..7a38953ba 100644 --- a/hw/kdrive/ephyr/ephyrinit.c +++ b/hw/kdrive/ephyr/ephyrinit.c @@ -26,6 +26,7 @@ #include #include "dix/dix_priv.h" +#include "dix/settings_priv.h" #include "os/cmdline.h" #include "os/ddx_priv.h" #include "os/log_priv.h" @@ -385,7 +386,7 @@ OsVendorInit(void) { EPHYR_DBG("mark"); - if (SeatId) + if (dixSettingSeatId) hostx_use_sw_cursor(); if (hostx_want_host_cursor()) diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c index 865e73ef3..e293c7d03 100644 --- a/hw/kdrive/src/kdrive.c +++ b/hw/kdrive/src/kdrive.c @@ -25,10 +25,10 @@ #include "config/hotplug_priv.h" #include "dix/dix_priv.h" #include "dix/screenint_priv.h" +#include "dix/settings_priv.h" +#include "mi/mi_priv.h" #include "os/cmdline.h" #include "os/ddx_priv.h" - -#include "mi/mi_priv.h" #include "os/osdep.h" #include "kdrive.h" @@ -1129,7 +1129,7 @@ KdInitOutput(int argc, char **argv) xorgGlxCreateVendor(); #if defined(CONFIG_UDEV) || defined(CONFIG_HAL) - if (SeatId) /* Enable input hot-plugging */ + if (dixSettingSeatId) /* Enable input hot-plugging */ config_pre_init(); #endif } diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index 30fd28bb7..bc36c021c 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -42,6 +42,7 @@ #include "dix/input_priv.h" #include "dix/inpututils_priv.h" #include "dix/screenint_priv.h" +#include "dix/settings_priv.h" #include "mi/mi_priv.h" #include "mi/mipointer_priv.h" #include "os/cmdline.h" @@ -1432,7 +1433,7 @@ KdInitInput(void) mieqInit(); #if defined(CONFIG_UDEV) || defined(CONFIG_HAL) - if (SeatId) /* Enable input hot-plugging */ + if (dixSettingSeatId) /* Enable input hot-plugging */ config_init(); #endif } @@ -1441,7 +1442,7 @@ void KdCloseInput(void) { #if defined(CONFIG_UDEV) || defined(CONFIG_HAL) - if (SeatId) /* Input hot-plugging is enabled */ + if (dixSettingSeatId) /* Input hot-plugging is enabled */ config_fini(); #endif @@ -2302,7 +2303,7 @@ NewInputDeviceRequest(InputOption *options, InputAttributes * attrs, #ifdef CONFIG_HAL else if (strcmp(key, "_source") == 0 && strcmp(value, "server/hal") == 0) { - if (SeatId) { + if (dixSettingSeatId) { /* Input hot-plugging is enabled */ if (attrs->flags & ATTR_POINTER) { pi = KdNewPointer(); @@ -2329,7 +2330,7 @@ NewInputDeviceRequest(InputOption *options, InputAttributes * attrs, #ifdef CONFIG_UDEV else if (strcmp(key, "_source") == 0 && strcmp(value, "server/udev") == 0) { - if (SeatId) { + if (dixSettingSeatId) { /* Input hot-plugging is enabled */ if (attrs->flags & ATTR_POINTER) { pi = KdNewPointer(); diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 21d41c2e3..9a241abd5 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -240,7 +240,7 @@ xf86ValidateFontPath(char *path) pointertype _l, _p; \ \ for (_l = (listhead), _p = NULL; !_p && _l; _l = (pointertype)_l->list.next) { \ - if (!_l->match_seat || (SeatId && xf86nameCompare(_l->match_seat, SeatId) == 0)) \ + if (!_l->match_seat || (dixSettingSeatId && xf86nameCompare(_l->match_seat, dixSettingSeatId) == 0)) \ _p = _l; \ } \ \ diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 78d684543..c11f0d1de 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -595,8 +595,8 @@ InitOutput(int argc, char **argv) if (xf86Info.vtno >= 0) AddCallback(&RootWindowFinalizeCallback, AddVTAtoms, NULL); - if (SeatId) - AddCallback(&RootWindowFinalizeCallback, AddSeatId, SeatId); + if (dixSettingSeatId) + AddCallback(&RootWindowFinalizeCallback, AddSeatId, dixSettingSeatId); /* * Use the previously collected parts to setup screenInfo diff --git a/include/globals.h b/include/globals.h index 400143f4d..b5cd17827 100644 --- a/include/globals.h +++ b/include/globals.h @@ -8,6 +8,4 @@ extern _X_EXPORT int monitorResolution; -extern _X_EXPORT char *SeatId; - #endif /* !_XSERV_GLOBAL_H_ */ diff --git a/os/utils.c b/os/utils.c index 4c41e313b..cd4de0196 100644 --- a/os/utils.c +++ b/os/utils.c @@ -133,8 +133,6 @@ Bool enableIndirectGLX = FALSE; Bool PanoramiXExtensionDisabledHack = FALSE; #endif /* XINERAMA */ -char *SeatId = NULL; - sig_atomic_t inSignalContext = FALSE; #ifdef MONOTONIC_CLOCK @@ -413,7 +411,7 @@ ProcessCommandLine(int argc, char *argv[]) ErrorF("Failed to disable listen for %s transport", defaultNoListenList[i]); } - SeatId = getenv("XDG_SEAT"); + dixSettingSeatId = getenv("XDG_SEAT"); #ifdef CONFIG_SYSLOG xorgSyslogIdent = getenv("SYSLOG_IDENT"); @@ -635,7 +633,7 @@ ProcessCommandLine(int argc, char *argv[]) } else if (strcmp(argv[i], "-seat") == 0) { if (++i < argc) - SeatId = argv[i]; + dixSettingSeatId = argv[i]; else UseMsg(); }