xserver: Branch 'master'
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Feb 12 00:23:33 UTC 2025
dix/display.c | 19 +++++++++++++++++++
dix/globals.c | 2 --
dix/meson.build | 1 +
include/dix.h | 11 +++++++++++
4 files changed, 31 insertions(+), 2 deletions(-)
New commits:
commit 2e0c19b6d93663c6874d133f8a88267eee8cc16e
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date: Tue Feb 11 19:08:30 2025 +0100
dix: add getter for display name
Xrdp needs to know the current display name (for setting up it's
own server sockets accordingly). Instead of exporting an internal
field, adding a little getter for this.
Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1783>
diff --git a/dix/display.c b/dix/display.c
new file mode 100644
index 000000000..5e8cf7bc5
--- /dev/null
+++ b/dix/display.c
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: MIT OR X11
+ *
+ * Copyright © 2024 Enrico Weigelt, metux IT consult <info at metux.net>
+ */
+#include <dix-config.h>
+
+#include "dix/dix_priv.h"
+#include "include/dix.h"
+#include "include/screenint.h"
+
+const char *display = "0";
+int displayfd = -1;
+
+const char *dixGetDisplayName(ScreenPtr *pScreen)
+{
+ // pScreen currently is ignored as the value is global,
+ // but this might perhaps change in the future.
+ return display;
+}
diff --git a/dix/globals.c b/dix/globals.c
index 5baee0af6..f0ce065df 100644
--- a/dix/globals.c
+++ b/dix/globals.c
@@ -116,7 +116,5 @@ TimeStamp currentTime;
int defaultColorVisualClass = -1;
int monitorResolution = 0;
-const char *display;
-int displayfd = -1;
Bool explicit_display = FALSE;
char *ConnectionInfo;
diff --git a/dix/meson.build b/dix/meson.build
index aa0c908dc..78f3b1f9e 100644
--- a/dix/meson.build
+++ b/dix/meson.build
@@ -5,6 +5,7 @@ srcs_dix = [
'cursor.c',
'devices.c',
'dispatch.c',
+ 'display.c',
'dixfonts.c',
'main.c',
'dixutils.c',
diff --git a/include/dix.h b/include/dix.h
index 750b9f8df..33db66b05 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -407,4 +407,15 @@ IsFloating(DeviceIntPtr dev);
extern _X_EXPORT void *lastGLContext;
+/**
+ * @brief get display string for given screen
+ *
+ * Entry point for drivers/modules that really need to know what
+ * display ID we're running on (eg. xrdp).
+ *
+ * @param pScreen pointer to ScreenRec to query.
+ * @return pointer to string, valid as long as the pScreen is, owned by DIX.
+ */
+_X_EXPORT const char *dixGetDisplayName(ScreenPtr *pScreen);
+
#endif /* DIX_H */
More information about the xorg-commit
mailing list