aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-07-31 23:18:41 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-09-29 17:10:05 +0200
commita91e34a8a2ae3b19726f5ecca256b34464af8d40 (patch)
tree3e1504fc0f35ee798a3a093b39ca9393ed5936ef /nx-X11/programs/Xserver/hw/nxagent
parent3b94b9c64f40f5c10196da33725ccf04ed63bfba (diff)
downloadnx-libs-a91e34a8a2ae3b19726f5ecca256b34464af8d40.tar.gz
nx-libs-a91e34a8a2ae3b19726f5ecca256b34464af8d40.tar.bz2
nx-libs-a91e34a8a2ae3b19726f5ecca256b34464af8d40.zip
Imakefile: make NXAGENT_RANDR_MODE_PREFIX configurable via macro
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Imakefile3
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Screen.c10
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Utils.h4
3 files changed, 10 insertions, 7 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile
index 0e2effff2..ff9538f3e 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile
+++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile
@@ -207,7 +207,7 @@ INCLUDES = \
# NXAGENT_SHAPE2 New shape code
# NXAGENT_FIXKEYS Force the release of pressed key when losing focus
# NXAGENT_CLIPBOARD Enables clipboard cut and paste function between X servers.
-# NXAGENT_RANDR_MODE_PREFIX Use prefixed (i.e., nx_<x>x<y>) RandR modes
+# NXAGENT_RANDR_MODE_PREFIX Prefix for RandR modes (i.e., nx_<x>x<y>) (default: nx_)
# NXAGENT_RANDR_XINERAMA_CLIPPING cut off invisible window parts in xinerama mode (you probably do not want this)
# NXAGENT_TIMESTAMP print duration for some routines
#
@@ -259,7 +259,6 @@ DEFINES = \
-DNXAGENT_WAKEUP=1000 \
-DNXAGENT_ONSTART \
-DNXAGENT_ARTSD \
- -DNXAGENT_RANDR_MODE_PREFIX \
-UNX_DEBUG_INPUT \
-DRANDR_10_INTERFACE=1 \
-DRANDR_12_INTERFACE=1 \
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
index 3b1d5f450..0fae9b704 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
@@ -210,6 +210,10 @@ RegionRec nxagentShadowUpdateRegion;
#define NXAGENT_DEFAULT_DPI 96
#define NXAGENT_AUTO_DPI -1
+#ifndef NXAGENT_RANDR_MODE_PREFIX
+#define NXAGENT_RANDR_MODE_PREFIX nx_
+#endif
+
extern Bool nxagentAutoDPI;
/*
@@ -4220,15 +4224,11 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
memset(&modeInfo, '\0', sizeof(modeInfo));
-#ifdef NXAGENT_RANDR_MODE_PREFIX
/* avoid collisions with pre-existing default modes by using a
separate namespace. If we'd simply use XxY we could not
distinguish between pre-existing modes which should stay
and our own modes that should be removed after use. */
- sprintf(name, "nx_%dx%d", new_w, new_h);
-#else
- sprintf(name, "%dx%d", new_w, new_h);
-#endif
+ sprintf(name, "%s%dx%d", QUOTE(NXAGENT_RANDR_MODE_PREFIX), new_w, new_h);
modeInfo.width = new_w;
modeInfo.height = new_h;
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Utils.h b/nx-X11/programs/Xserver/hw/nxagent/Utils.h
index 0aebda839..e61a79144 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Utils.h
+++ b/nx-X11/programs/Xserver/hw/nxagent/Utils.h
@@ -47,4 +47,8 @@ static inline const char * validateString(const char *str) {
#define SAFE_XFree(what) do {if (what) {XFree(what); what = NULL;}} while (0)
#define SAFE_free(what) do {free(what); what = NULL;} while (0)
+/* some helper macros to produce a quoted string from other macros */
+#define QUOTEEXP(str) #str
+#define QUOTE(str) QUOTEEXP(str)
+
#endif /* __Utils_H__ */