From a91e34a8a2ae3b19726f5ecca256b34464af8d40 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 31 Jul 2019 23:18:41 +0200 Subject: Imakefile: make NXAGENT_RANDR_MODE_PREFIX configurable via macro --- nx-X11/programs/Xserver/hw/nxagent/Imakefile | 3 +-- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 10 +++++----- nx-X11/programs/Xserver/hw/nxagent/Utils.h | 4 ++++ 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'nx-X11/programs/Xserver') 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) RandR modes +# NXAGENT_RANDR_MODE_PREFIX Prefix for RandR modes (i.e., nx_x) (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__ */ -- cgit v1.2.3