diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-06-18 19:46:28 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-06-18 19:46:28 +0200 |
commit | c31ae1eed4d2a77e0962bee16279459cb5f7cd65 (patch) | |
tree | 8b2a43fffc3d0c4498b804f32c8600baad629915 /nx-X11/programs/Xserver/hw/nxagent | |
parent | 2dd1a1fe6dbbffd764ea0a36743ec7d8e83b2ad6 (diff) | |
parent | 4b4a6a35c47590bd4ab1c16d9bf1398bb51624b2 (diff) | |
download | nx-libs-c31ae1eed4d2a77e0962bee16279459cb5f7cd65.tar.gz nx-libs-c31ae1eed4d2a77e0962bee16279459cb5f7cd65.tar.bz2 nx-libs-c31ae1eed4d2a77e0962bee16279459cb5f7cd65.zip |
Merge branch 'sunweaver-pr/rrxinerama-vs-panoramix-with-disable-support' into 3.6.x
Attributes GH PR #135: https://github.com/ArcticaProject/nx-libs/pull/135
Reviewed by: Ulrich Sibiller <uli42@gmx.de> -- Sat, 18 Jun 2016 05:25:08 -0700
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Args.c | 62 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Options.c | 2 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Options.h | 12 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Screen.c | 5 |
4 files changed, 48 insertions, 33 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 2590dd6c3..6e6d61772 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -86,6 +86,18 @@ is" without express or implied warranty. #endif +#ifdef PANORAMIX + #define PANORAMIX_DISABLED_COND (noPanoramiXExtension || PanoramiXExtensionDisabledHack) +#else + #define PANORAMIX_DISABLED_COND TRUE +#endif + +#ifdef RANDR + #define RRXINERAMA_DISABLED_COND noRRXineramaExtension +#else + #define RRXINERAMA_DISABLED_COND TRUE +#endif + /* * Define this to force the dispatcher * to always use the dumb scheduler. @@ -103,6 +115,8 @@ extern int _XGetBitsPerPixel(Display *dpy, int depth); extern char dispatchExceptionAtReset; +extern const char *__progname; + char nxagentDisplayName[1024]; Bool nxagentSynchronize = False; @@ -1047,6 +1061,13 @@ int ddxProcessArgument(int argc, char *argv[], int i) return 0; } + /* + * Disable Xinerama (i.e. fake it in Screen.c) if somehow Xinerama support + * has been disabled on the cmdline. + */ + if (PANORAMIX_DISABLED_COND && RRXINERAMA_DISABLED_COND) + nxagentChangeOption(Xinerama, 0); + return 0; } @@ -1205,33 +1226,32 @@ static void nxagentParseOptions(char *name, char *value) } else if (!strcmp(name, "xinerama")) { -#ifdef PANORAMIX - if (!PanoramiXExtensionDisabledHack) +#if !defined(PANORAMIX) && !defined(RANDR) + nxagentChangeOption(Xinerama, 0); + fprintf(stderr, "Warning: No Xinerama support compiled into %s.\n", __progname); + return; +#else + if (PANORAMIX_DISABLED_COND && RRXINERAMA_DISABLED_COND) + nxagentChangeOption(Xinerama, 0); + fprintf(stderr, "Warning: XINERAMA extension has been disabled on %s startup.\n", __progname); + return; + + if (!strcmp(value, "1")) { - if (!strcmp(value, "1")) - { - nxagentChangeOption(Xinerama, 1); - } - else if (!strcmp(value, "0")) - { - nxagentChangeOption(Xinerama, 0); - } - else - { - fprintf(stderr, "Warning: Ignoring bad value '%s' for option 'xinerama'.\n", - validateString(value)); - } + nxagentChangeOption(Xinerama, 1); + return; } - else + else if (!strcmp(value, "0")) { nxagentChangeOption(Xinerama, 0); - fprintf(stderr, "Warning: Xinerama extension has been disabled via -disablexineramaextension cmdline switch.\n"); } -#else - nxagentChangeOption(Xinerama, 0); - fprintf(stderr, "Warning: No Xinerama support compiled into nxagent.\n"); -#endif /* of PANORAMIX */ + else + { + fprintf(stderr, "Warning: Ignoring bad value '%s' for option 'xinerama'.\n", + validateString(value)); + } return; +#endif } else if (!strcmp(name, "resize")) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c index 8a3275c64..d0ba8aff5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c @@ -155,7 +155,7 @@ void nxagentInitOptions() nxagentOptions.ImageRateLimit = 0; - nxagentOptions.Xinerama = 0; + nxagentOptions.Xinerama = 1; nxagentOptions.SleepTime = DEFAULT_SLEEP_TIME; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.h b/nx-X11/programs/Xserver/hw/nxagent/Options.h index 02b886242..7e9f8d2ea 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.h @@ -390,12 +390,12 @@ typedef struct _AgentOptions int NoRootlessExit; /* - * Store if the user wants Xinerama. There's a variable called - * noPanoramiXExtension in os/utils.c but we cannot rely on that - * because RandR and Panoramix change its value when trying to - * initialize. So we use this variable to save the user preference - * provided by the -/+xinerama parameter before initalizing those - * extensions. + * Store if the user wants Xinerama. There are variables called + * noPanoramiXExtension noRRXineramaExtensison in os/utils.c but + * we cannot rely on them because RandR and PanoramiX change their + * values when trying to initialize. So we use this variable to + * save the user preference provided by the -/+(rr)xinerama parameter(s) + * before initalizing those extensions. */ int Xinerama; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 20ec3672a..50d278ed7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -1114,11 +1114,6 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen, nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth)); nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight)); - /* PanoramiXExtension enabled via cmdline, turn on Xinerama in nxagent - */ - if( (!noPanoramiXExtension) && (!PanoramiXExtensionDisabledHack) ) - nxagentOption(Xinerama) = True; - if (nxagentReconnectTrap == 0) { if (nxagentOption(Persistent)) |