Unverified Commit c31ae1ee authored by Mike Gabriel's avatar Mike Gabriel

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
parents 2dd1a1fe 4b4a6a35
...@@ -86,6 +86,18 @@ is" without express or implied warranty. ...@@ -86,6 +86,18 @@ is" without express or implied warranty.
#endif #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 * Define this to force the dispatcher
* to always use the dumb scheduler. * to always use the dumb scheduler.
...@@ -103,6 +115,8 @@ extern int _XGetBitsPerPixel(Display *dpy, int depth); ...@@ -103,6 +115,8 @@ extern int _XGetBitsPerPixel(Display *dpy, int depth);
extern char dispatchExceptionAtReset; extern char dispatchExceptionAtReset;
extern const char *__progname;
char nxagentDisplayName[1024]; char nxagentDisplayName[1024];
Bool nxagentSynchronize = False; Bool nxagentSynchronize = False;
...@@ -1047,6 +1061,13 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -1047,6 +1061,13 @@ int ddxProcessArgument(int argc, char *argv[], int i)
return 0; 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; return 0;
} }
...@@ -1205,12 +1226,20 @@ static void nxagentParseOptions(char *name, char *value) ...@@ -1205,12 +1226,20 @@ static void nxagentParseOptions(char *name, char *value)
} }
else if (!strcmp(name, "xinerama")) else if (!strcmp(name, "xinerama"))
{ {
#ifdef PANORAMIX #if !defined(PANORAMIX) && !defined(RANDR)
if (!PanoramiXExtensionDisabledHack) 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); nxagentChangeOption(Xinerama, 1);
return;
} }
else if (!strcmp(value, "0")) else if (!strcmp(value, "0"))
{ {
...@@ -1221,17 +1250,8 @@ static void nxagentParseOptions(char *name, char *value) ...@@ -1221,17 +1250,8 @@ static void nxagentParseOptions(char *name, char *value)
fprintf(stderr, "Warning: Ignoring bad value '%s' for option 'xinerama'.\n", fprintf(stderr, "Warning: Ignoring bad value '%s' for option 'xinerama'.\n",
validateString(value)); validateString(value));
} }
}
else
{
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 */
return; return;
#endif
} }
else if (!strcmp(name, "resize")) else if (!strcmp(name, "resize"))
{ {
......
...@@ -155,7 +155,7 @@ void nxagentInitOptions() ...@@ -155,7 +155,7 @@ void nxagentInitOptions()
nxagentOptions.ImageRateLimit = 0; nxagentOptions.ImageRateLimit = 0;
nxagentOptions.Xinerama = 0; nxagentOptions.Xinerama = 1;
nxagentOptions.SleepTime = DEFAULT_SLEEP_TIME; nxagentOptions.SleepTime = DEFAULT_SLEEP_TIME;
} }
......
...@@ -390,12 +390,12 @@ typedef struct _AgentOptions ...@@ -390,12 +390,12 @@ typedef struct _AgentOptions
int NoRootlessExit; int NoRootlessExit;
/* /*
* Store if the user wants Xinerama. There's a variable called * Store if the user wants Xinerama. There are variables called
* noPanoramiXExtension in os/utils.c but we cannot rely on that * noPanoramiXExtension noRRXineramaExtensison in os/utils.c but
* because RandR and Panoramix change its value when trying to * we cannot rely on them because RandR and PanoramiX change their
* initialize. So we use this variable to save the user preference * values when trying to initialize. So we use this variable to
* provided by the -/+xinerama parameter before initalizing those * save the user preference provided by the -/+(rr)xinerama parameter(s)
* extensions. * before initalizing those extensions.
*/ */
int Xinerama; int Xinerama;
......
...@@ -1114,11 +1114,6 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen, ...@@ -1114,11 +1114,6 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen,
nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth)); nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth));
nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight)); 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 (nxagentReconnectTrap == 0)
{ {
if (nxagentOption(Persistent)) if (nxagentOption(Persistent))
......
...@@ -87,6 +87,7 @@ extern Bool noMITShmExtension; ...@@ -87,6 +87,7 @@ extern Bool noMITShmExtension;
#ifdef RANDR #ifdef RANDR
extern Bool noRRExtension; extern Bool noRRExtension;
extern Bool noRRXineramaExtension;
#endif #endif
#ifdef RENDER #ifdef RENDER
......
...@@ -179,6 +179,7 @@ Bool noMITShmExtension = FALSE; ...@@ -179,6 +179,7 @@ Bool noMITShmExtension = FALSE;
#endif #endif
#ifdef RANDR #ifdef RANDR
Bool noRRExtension = FALSE; Bool noRRExtension = FALSE;
Bool noRRXineramaExtension = FALSE;
#endif #endif
#ifdef RENDER #ifdef RENDER
Bool noRenderExtension = FALSE; Bool noRenderExtension = FALSE;
...@@ -664,10 +665,14 @@ void UseMsg(void) ...@@ -664,10 +665,14 @@ void UseMsg(void)
ErrorF("-x string loads named extension at init time \n"); ErrorF("-x string loads named extension at init time \n");
ErrorF("-maxbigreqsize set maximal bigrequest size \n"); ErrorF("-maxbigreqsize set maximal bigrequest size \n");
#ifdef PANORAMIX #ifdef PANORAMIX
ErrorF("+xinerama Enable XINERAMA extension\n"); ErrorF("+xinerama Enable XINERAMA (PanoramiX) extension\n");
ErrorF("-xinerama Disable XINERAMA extension\n"); ErrorF("-xinerama Disable XINERAMA (PanoramiX) extension (default)\n");
ErrorF("-disablexineramaextension Disable XINERAMA extension\n"); ErrorF("-disablexineramaextension Disable XINERAMA extension\n");
#endif #endif
#ifdef RANDR
ErrorF("+rrxinerama Enable XINERAMA (via RandR) extension (default)\n");
ErrorF("-rrxinerama Disable XINERAMA (via RandR) extension\n");
#endif
#ifdef SMART_SCHEDULE #ifdef SMART_SCHEDULE
ErrorF("-dumbSched Disable smart scheduling, enable old behavior\n"); ErrorF("-dumbSched Disable smart scheduling, enable old behavior\n");
ErrorF("-schedInterval int Set scheduler interval in msec\n"); ErrorF("-schedInterval int Set scheduler interval in msec\n");
...@@ -1037,6 +1042,14 @@ ProcessCommandLine(int argc, char *argv[]) ...@@ -1037,6 +1042,14 @@ ProcessCommandLine(int argc, char *argv[])
PanoramiXExtensionDisabledHack = TRUE; PanoramiXExtensionDisabledHack = TRUE;
} }
#endif #endif
#ifdef RANDR
else if ( strcmp( argv[i], "+rrxinerama") == 0){
noRRXineramaExtension = FALSE;
}
else if ( strcmp( argv[i], "-rrxinerama") == 0){
noRRXineramaExtension = TRUE;
}
#endif
else if ( strcmp( argv[i], "-x") == 0) else if ( strcmp( argv[i], "-x") == 0)
{ {
if(++i >= argc) if(++i >= argc)
......
...@@ -107,6 +107,8 @@ static int ProcRRXineramaIsActive(ClientPtr client); ...@@ -107,6 +107,8 @@ static int ProcRRXineramaIsActive(ClientPtr client);
static int ProcRRXineramaQueryScreens(ClientPtr client); static int ProcRRXineramaQueryScreens(ClientPtr client);
static int SProcRRXineramaDispatch(ClientPtr client); static int SProcRRXineramaDispatch(ClientPtr client);
extern Bool noRRXineramaExtension;
/* Proc */ /* Proc */
int int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment