From 129cc6afd4ac49b458659ae8bb0d5201942c2aab Mon Sep 17 00:00:00 2001 From: Mihai Moldovan <ïonic@ionic.de> Date: Fri, 27 May 2016 15:52:50 +0000 Subject: nx-X11/programs/Xserver/hw/nxagent/Handlers.h: fix stack smashing related to different data type sizes between Xserver and Xlib. While on the X server side we were expecting a 32bit value, the Xlib side in nxcompext wrote a 64bit integer to the 32bit location, hence overwriting "random" data on the stack (most notably the return adress.) We can work around this by using the Xlib-based Window data type on the server-side as well, but this problem is likely a more general one. Calling functions from libcompext in nxagent sounds like a bad idea. Other code locations might well be affected by issues alike to that as well. In order to silence compiler warnings, use a "macro hack" for overriding the "Window" type in NXlib.h. --- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index cadb8e58a..1beff090b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -32,7 +32,10 @@ #include "Screen.h" #include "Millis.h" +#define Window XlibWindow #include +#undef Window + #include /* @@ -956,7 +959,24 @@ void nxagentShadowWakeupHandler(void * data, int count, void * mask) void nxagentHandleCollectInputFocusEvent(int resource) { - Window window; + /* + * While we don't even need window or revert_to later on, a discrepancy in + * data type sizes between the X server (Window being a 32bit ID) and + * the Xlib (Window being a 64bit ID) will lead to stack corruption here. + * Calling functions from nxcompext from nxagent sounds like a very bad idea + * to begin with, but let's assume that's necessary for now and work around + * the corruption issue. + * + * Even though the NXlib header shows that the function expects a Window-sized + * parameter, it's not the Window type as defined and used within the X.Org + * Server, but an Xlib type. Hence, we'll be using the "XlibWindow" type here + * and to avoid compiler warnings, "rewrite" the NXlib.h header file via + * overriding the original "Window" type with the XlibWindow type, including + * the header file and undefining the macro again, essentially unshadowing + * the original type. + */ + XlibWindow window; + int revert_to; if (NXGetCollectedInputFocus(nxagentDisplay, resource, &window, &revert_to) == 0) -- cgit v1.2.3 From 04d2fe3aef464560de16d5b15ed91f8d63c6fb09 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 13 Jun 2016 01:56:07 +0200 Subject: nxagentReversePointerMap: Don't assume Xevent.xbutton.button is always greater than zero. We have seen Xevent.xbutton.button being set to AnyButton (equaling 0). Fixes ArcticaProject/nx-libs#92 Fixes X2GoBTS#791 --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Pointer.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index ffb593750..0a6540fa3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -1252,7 +1252,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was X.xbutton.subwindow == None)) { x.u.u.type = ButtonPress; - x.u.u.detail = inputInfo.pointer -> button -> map[nxagentReversePointerMap[X.xbutton.button - 1]]; + x.u.u.detail = inputInfo.pointer -> button -> map[nxagentReversePointerMap[X.xbutton.button]]; x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis(); if (nxagentOption(Rootless)) @@ -1325,7 +1325,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was if (minimize != True) { x.u.u.type = ButtonRelease; - x.u.u.detail = inputInfo.pointer -> button -> map[nxagentReversePointerMap[X.xbutton.button - 1]]; + x.u.u.detail = inputInfo.pointer -> button -> map[nxagentReversePointerMap[X.xbutton.button]]; x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis(); if (nxagentOption(Rootless)) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c index ce2b37a90..8a8ed85b1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c @@ -186,6 +186,6 @@ void nxagentInitPointerMap(void) for (i = 1; i <= numButtons; i++) { - nxagentReversePointerMap[pointerMap[i - 1] - 1] = i; + nxagentReversePointerMap[pointerMap[i - 1]] = i; } } -- cgit v1.2.3 From 4d6d3c56706e0c5a0725c13356c28d3655f72cac Mon Sep 17 00:00:00 2001 From: Mihai Moldovan <ïonic@ionic.de> Date: Fri, 17 Jun 2016 01:45:40 +0000 Subject: {nx-X11/programs/Xserver/hw/nxagent/{{Args,Handlers,Image,Options}.c,Options.h},nxcomp/{Loop,Misc}.cpp}: add configurable sleep delay if session is suspended. --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 38 ++++++++++++++++++++++ nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 46 +++++++++++++++++++-------- nx-X11/programs/Xserver/hw/nxagent/Image.c | 14 ++------ nx-X11/programs/Xserver/hw/nxagent/Options.c | 2 ++ nx-X11/programs/Xserver/hw/nxagent/Options.h | 7 ++++ 5 files changed, 83 insertions(+), 24 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 59d3deb63..2590dd6c3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -1339,6 +1339,44 @@ static void nxagentParseOptions(char *name, char *value) nxagentChangeOption(Clipboard, ClipboardBoth); } } + else if (!strcmp(name, "sleep")) + { + long sleep_parse = 0; + + errno = 0; + sleep_parse = strtol(value, NULL, 10); + + if ((errno) && (0 == sleep_parse)) + { + fprintf(stderr, "nxagentParseOptions: Unable to convert value [%s] of option [%s]. " + "Ignoring option.\n", + validateString(value), validateString(name)); + + return; + } + + if ((long) UINT_MAX < sleep_parse) + { + sleep_parse = UINT_MAX; + + fprintf(stderr, "nxagentParseOptions: Warning: value [%s] of option [%s] " + "out of range, clamped to [%u].\n", + validateString(value), validateString(name), sleep_parse); + } + + if (0 > sleep_parse) + { + sleep_parse = 0; + + fprintf(stderr, "nxagentParseOptions: Warning: value [%s] of option [%s] " + "out of range, clamped to [%u].\n", + validateString(value), validateString(name), sleep_parse); + } + + nxagentChangeOption(SleepTime, sleep_parse); + + return; + } else { #ifdef DEBUG diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index 1beff090b..ba4034255 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -62,14 +62,6 @@ #define FLUSH_AFTER_MULTIPLE_READS -/* - * Introduce a small delay after each - * loop if the session is down. The - * value is in milliseconds. - */ - -#define LOOP_DELAY_IF_DOWN 50 - /* * The soft limit should roughly match * the size of the Xlib I/O buffer. @@ -246,12 +238,21 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) * not connected to a valid display. */ - if (NXDisplayError(nxagentDisplay) == 1 && nxagentShadowCounter == 0) + if (NXDisplayError(nxagentDisplay) == 1 && nxagentShadowCounter == 0 && nxagentOption(SleepTime) > 0) { - usleep(LOOP_DELAY_IF_DOWN * 1000); +#ifdef TEST + fprintf(stderr, "nxagentBlockHandler: sleeping for %d milliseconds for slowdown.\n", + nxagentOption(SleepTime)); +#endif + usleep(nxagentOption(SleepTime) * 1000); now = GetTimeInMillis(); } +#ifdef TEST + else if (0 == nxagentOption(SleepTime)) { + fprintf(stderr, "nxagentBlockHandler: not sleeping for slowdown.\n"); + } +#endif /* * Update the shadow display. This is @@ -743,9 +744,17 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas nxagentHandleConnectionChanges(); } - if (nxagentSessionState == SESSION_DOWN) + if (nxagentSessionState == SESSION_DOWN && nxagentOption(SleepTime) > 0) { - usleep(50 * 1000); +#ifdef TEST + fprintf(stderr, "nxagentBlockHandler: sleeping for %d milliseconds for slowdown.\n", + nxagentOption(SleepTime)); +#endif + usleep(nxagentOption(SleepTime) * 1000); + } +#ifdef TEST + else if (0 == nxagentOption(SleepTime)) { + fprintf(stderr, "nxagentBlockHandler: not sleeping for slowdown.\n"); } #ifndef __CYGWIN32__ @@ -826,7 +835,18 @@ FIXME: Must queue multiple writes and handle #ifdef __CYGWIN32__ - usleep(50 * 1000); + if (nxagentOption(SleepTime) > 0) { +#ifdef TEST + fprintf(stderr, "nxagentShadowBlockHandler: sleeping for %d milliseconds for slowdown.\n", + nxagentOption(SleepTime)); +#endif + usleep(nxagentOption(SleepTime) * 1000); + } +#ifdef TEST + else if (0 == nxagentOption(SleepTime)) { + fprintf(stderr, "nxagentShadowBlockHandler: not sleeping for slowdown.\n"); + } +#endif (*timeout) -> tv_sec = 0; (*timeout) -> tv_usec = 50 * 1000; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c index 6a7d46c35..a158a11db 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -68,15 +68,6 @@ #define IMAGE_UNIQUE_RATIO 10 -/* - * Introduce a small delay after each image - * operation if the session is down. Value - * is in microseconds and is multiplied by - * the image data size in kilobytes. - */ - -#define IMAGE_DELAY_IF_DOWN 250 - /* * Preferred pack and split parameters we * got from the NX transport. @@ -521,11 +512,12 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, length = nxagentImageLength(dstWidth, dstHeight, format, leftPad, depth); if (nxagentShadowCounter == 0 && - NXDisplayError(nxagentDisplay) == 1) + NXDisplayError(nxagentDisplay) == 1 && + nxagentOption(SleepTime) > 0) { int us; - us = IMAGE_DELAY_IF_DOWN * (length / 1024); + us = nxagentOption(SleepTime) * 4 * (length / 1024); us = (us < 10000 ? 10000 : (us > 1000000 ? 1000000 : us)); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c index dbe200273..8a3275c64 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c @@ -156,6 +156,8 @@ void nxagentInitOptions() nxagentOptions.ImageRateLimit = 0; nxagentOptions.Xinerama = 0; + + 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 5bf1597d5..02b886242 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.h @@ -28,6 +28,7 @@ #define UNDEFINED -1 #define COPY_UNLIMITED -1 +#define DEFAULT_SLEEP_TIME 50 extern unsigned int nxagentPrintGeometryFlags; @@ -399,6 +400,12 @@ typedef struct _AgentOptions int Xinerama; + /* + * Sleep delay in microseconds. + */ + + unsigned int SleepTime; + } AgentOptionsRec; typedef AgentOptionsRec *AgentOptionsPtr; -- cgit v1.2.3 From d130494039d7a03aea25c911522223f60c159644 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 10 Jun 2016 01:05:58 +0200 Subject: Properly enable/disable Xinerama support in nxagent via cmdline options provider in Xserver/os/utils.c. * Xinerama defaults to enabled, using RRXineramaExtension (i.e. cmdline option: +rrxinerama). * Cmdline option -rrxinerama disables Xinerama support entirely. * Cmdline option +xinerama switches from RRXineramaExtension to PanoramiXExtension. * Cmdline option -xinerama is actually non-functional (i.e. the default). * If the nx/nx option "xinerama" is handed over to nxagent, then Xinerama is only switched on if that given option enables it (value: 1) _and_ if either of the Xinerama extensions (PanoramiX or RRXinerama) has been initialized (via cmdline options above). Fixes ArcticaProject/nx-libs#117. Fixes ArcticaProject/nx-libs#134 (makes flawed PR#134 obsolete). --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 62 ++++++++++++++++++---------- nx-X11/programs/Xserver/hw/nxagent/Options.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Options.h | 12 +++--- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 5 --- 4 files changed, 48 insertions(+), 33 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent') 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)) -- cgit v1.2.3 From 9de3d26efbb5859b5d48bca35e126fc8a44dac1f Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sat, 18 Jun 2016 19:50:10 +0200 Subject: hw/nxagent/Options.h: Grammar fix in comment. --- nx-X11/programs/Xserver/hw/nxagent/Options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.h b/nx-X11/programs/Xserver/hw/nxagent/Options.h index 7e9f8d2ea..257a332f2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.h @@ -391,7 +391,7 @@ typedef struct _AgentOptions /* * Store if the user wants Xinerama. There are variables called - * noPanoramiXExtension noRRXineramaExtensison in os/utils.c but + * noPanoramiXExtension and 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) -- cgit v1.2.3 From 3db9a757fc54d94707aabe4d934d693c6b32edff Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 21 Jun 2016 03:56:29 +0200 Subject: hw/nxagent/Handlers.c: Regression fix since 6051dec. Close unclosed '#ifdef TEST'. --- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 1 + 1 file changed, 1 insertion(+) (limited to 'nx-X11/programs/Xserver/hw/nxagent') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index ba4034255..62cc54990 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -756,6 +756,7 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas else if (0 == nxagentOption(SleepTime)) { fprintf(stderr, "nxagentBlockHandler: not sleeping for slowdown.\n"); } +#endif #ifndef __CYGWIN32__ -- cgit v1.2.3 From 560fd4e5f9ab33a92776d0de512e551f2895994f Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 20 Jun 2016 11:21:46 +0200 Subject: nxagent/hw/NXextension.c: Allow CloseDownProc to be NULL. Required code de-duplication in nxagent. (Will be fixed by ArcticaProject/nx-libs#120 later on). --- nx-X11/programs/Xserver/hw/nxagent/NXextension.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent') diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXextension.c b/nx-X11/programs/Xserver/hw/nxagent/NXextension.c index 962367bf2..0c0145477 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXextension.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXextension.c @@ -111,7 +111,7 @@ AddExtension(char *name, int NumEvents, int NumErrors, int i; register ExtensionEntry *ext, **newexts; - if (!MainProc || !SwappedMainProc || !CloseDownProc || !MinorOpcodeProc) + if (!MainProc || !SwappedMainProc || !MinorOpcodeProc) return((ExtensionEntry *) NULL); if ((lastEvent + NumEvents > LAST_EVENT) || (unsigned)(lastError + NumErrors > LAST_ERROR)) @@ -296,7 +296,8 @@ CloseDownExtensions() for (i = NumExtensions - 1; i >= 0; i--) { - (* extensions[i]->CloseDown)(extensions[i]); + if (extensions[i]->CloseDown) + (* extensions[i]->CloseDown)(extensions[i]); NumExtensions = i; xfree(extensions[i]->name); for (j = extensions[i]->num_aliases; --j >= 0;) -- cgit v1.2.3 From c61bb8cc59bf645f1bf4dbc5fd5464d559b3ecad Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 20 Jun 2016 12:18:53 +0200 Subject: Move each screen's root-window pointer into ScreenRec. Backported from X.org: commit e7fae9ecc42ab5e73b89117722dbf4117d928f9a Author: Jamey Sharp Date: Sat May 22 00:26:28 2010 -0700 Move each screen's root-window pointer into ScreenRec. Many references to the WindowTable array already had the corresponding screen pointer handy, which meant they usually looked like "WindowTable[pScreen->myNum]". Adding a field to ScreenRec instead of keeping this information in a parallel array simplifies those expressions, and eliminates a MAXSCREENS-sized array. Since dix uses this data, a screen private entry isn't appropriate. xf86-video-dummy currently uses WindowTable, so it needs to be updated to reflect this change. Signed-off-by: Jamey Sharp Reviewed-by: Tiago Vignatti Tested-by: Tiago Vignatti (i686 GNU/Linux) Backport to nx-libs: Mike Gabriel --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 9 +++-- nx-X11/programs/Xserver/hw/nxagent/Composite.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 30 +++++++-------- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 20 +++++----- nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 50 ++++++++++++------------- nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXresource.c | 8 ++-- nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 30 ++++++++------- nx-X11/programs/Xserver/hw/nxagent/Pixmap.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 13 ++++--- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 42 ++++++++++----------- nx-X11/programs/Xserver/hw/nxagent/Splash.c | 6 +-- nx-X11/programs/Xserver/hw/nxagent/Window.c | 42 ++++++++++----------- nx-X11/programs/Xserver/hw/nxagent/Windows.h | 2 +- 16 files changed, 134 insertions(+), 130 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index f3656d2c0..a0dfbf602 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -22,6 +22,7 @@ #include "Xatom.h" #include "selection.h" #include "windowstr.h" +#include "scrnintstr.h" #include "Windows.h" #include "Atoms.h" @@ -255,7 +256,7 @@ void nxagentClearSelection(XEvent *X) NullGrab); } - CurrentSelections[i].window = WindowTable[0]->drawable.id; + CurrentSelections[i].window = screenInfo.screens[0]->root->drawable.id; CurrentSelections[i].client = NullClient; lastSelectionOwner[i].client = NULL; @@ -424,7 +425,7 @@ FIXME: Do we need this? * Fictitious window. */ - x.u.selectionRequest.requestor = WindowTable[0]->drawable.id; + x.u.selectionRequest.requestor = screenInfo.screens[0]->root->drawable.id; /* * Don't send the same window, some programs are @@ -1502,13 +1503,13 @@ int nxagentInitClipboard(WindowPtr pWin) lastSelectionOwner[nxagentPrimarySelection].selection = XA_PRIMARY; lastSelectionOwner[nxagentPrimarySelection].client = NullClient; - lastSelectionOwner[nxagentPrimarySelection].window = WindowTable[0]->drawable.id; + lastSelectionOwner[nxagentPrimarySelection].window = screenInfo.screens[0]->root->drawable.id; lastSelectionOwner[nxagentPrimarySelection].windowPtr = NULL; lastSelectionOwner[nxagentPrimarySelection].lastTimeChanged = GetTimeInMillis(); lastSelectionOwner[nxagentClipboardSelection].selection = nxagentClipboardAtom; lastSelectionOwner[nxagentClipboardSelection].client = NullClient; - lastSelectionOwner[nxagentClipboardSelection].window = WindowTable[0]->drawable.id; + lastSelectionOwner[nxagentClipboardSelection].window = screenInfo.screens[0]->root->drawable.id; lastSelectionOwner[nxagentClipboardSelection].windowPtr = NULL; lastSelectionOwner[nxagentClipboardSelection].lastTimeChanged = GetTimeInMillis(); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Composite.c b/nx-X11/programs/Xserver/hw/nxagent/Composite.c index ae3cbb5a4..d6239d619 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Composite.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Composite.c @@ -125,7 +125,7 @@ void nxagentRedirectDefaultWindows() for (i = 0; i < screenInfo.numScreens; i++) { - WindowPtr pWin = WindowTable[i]; + WindowPtr pWin = screenInfo.screens[i]->root; ScreenPtr pScreen = pWin -> drawable.pScreen; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index 9dac8066a..377e119ab 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -3292,7 +3292,7 @@ void nxagentSendDeferredBackgroundExposures(void) fprintf(stderr, "nxagentSendDeferredBackgroundExposures: Going to send deferred exposures to the root window.\n"); #endif - TraverseTree(WindowTable[0], nxagentClipAndSendClearExpose, (void *) nxagentDeferredBackgroundExposures); + TraverseTree(screenInfo.screens[0]->root, nxagentClipAndSendClearExpose, (void *) nxagentDeferredBackgroundExposures); RegionEmpty(nxagentDeferredBackgroundExposures); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 0a6540fa3..52b869f71 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -629,8 +629,8 @@ void nxagentShadowSwitchResizeMode(ScreenPtr pScreen) { nxagentShadowSetRatio(1.0, 1.0); - nxagentShadowCreateMainWindow(screenInfo.screens[DefaultScreen(nxagentDisplay)], WindowTable[0], - WindowTable[0] -> drawable.width, WindowTable[0] -> drawable.height); + nxagentShadowCreateMainWindow(screenInfo.screens[DefaultScreen(nxagentDisplay)], screenInfo.screens[0]->root, + screenInfo.screens[0]->root -> drawable.width, screenInfo.screens[0]->root -> drawable.height); sizeHints.max_width = nxagentOption(RootWidth); sizeHints.max_height = nxagentOption(RootHeight); @@ -640,13 +640,13 @@ void nxagentShadowSwitchResizeMode(ScreenPtr pScreen) else { nxagentShadowSetRatio(nxagentOption(Width) * 1.0 / - WindowTable[0] -> drawable.width, + screenInfo.screens[0]->root -> drawable.width, nxagentOption(Height) * 1.0 / - WindowTable[0] -> drawable.height); + screenInfo.screens[0]->root -> drawable.height); nxagentShadowCreateMainWindow(screenInfo.screens[DefaultScreen(nxagentDisplay)], - WindowTable[0], WindowTable[0] -> drawable.width, - WindowTable[0] -> drawable.height); + screenInfo.screens[0]->root, screenInfo.screens[0]->root -> drawable.width, + screenInfo.screens[0]->root -> drawable.height); sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); @@ -963,10 +963,10 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) case doDebugTree: { fprintf(stderr, "\n ========== nxagentRemoteWindowsTree ==========\n"); - nxagentRemoteWindowsTree(nxagentWindow(WindowTable[0]), 0); + nxagentRemoteWindowsTree(nxagentWindow(screenInfo.screens[0]->root), 0); fprintf(stderr, "\n========== nxagentInternalWindowsTree ==========\n"); - nxagentInternalWindowsTree(WindowTable[0], 0); + nxagentInternalWindowsTree(screenInfo.screens[0]->root, 0); break; } @@ -1405,7 +1405,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was (X.xmotion.y_root < nxagentLastEnteredTopLevelWindow -> drawable.y + 4)) { if (pWin && nxagentClientIsDialog(wClient(pWin)) == 0 && - nxagentLastEnteredTopLevelWindow -> parent == WindowTable[0] && + nxagentLastEnteredTopLevelWindow -> parent == screenInfo.screens[0]->root && nxagentLastEnteredTopLevelWindow -> overrideRedirect == False && X.xmotion.x_root > (nxagentLastEnteredTopLevelWindow -> drawable.x + (nxagentLastEnteredTopLevelWindow -> drawable.width >> 1) - 50) && @@ -1625,7 +1625,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was if (pWin != NULL) { for (pTLWin = pWin; - pTLWin -> parent != WindowTable[pTLWin -> drawable.pScreen -> myNum]; + pTLWin -> parent != pTLWin -> drawable.pScreen -> root; pTLWin = pTLWin -> parent); } @@ -2454,7 +2454,7 @@ FIXME: This can be maybe optimized by consuming the RegionValidate(&sum, &overlap); RegionIntersect(&sum, &sum, - &WindowTable[pWin->drawable.pScreen->myNum]->winSize); + &pWin->drawable.pScreen->root->winSize); #ifdef DEBUG fprintf(stderr, "nxagentHandleExposeEvent: Sending events for window id [%ld].\n", @@ -3147,7 +3147,7 @@ int nxagentCheckWindowConfiguration(XConfigureEvent* X) fprintf(stderr, "nxagentCheckWindowConfiguration: Before restacking top level window [%p]\n", (void *) nxagentWindowPtr(X -> window)); - for (pSib = WindowTable[0] -> firstChild; pSib; pSib = pSib -> nextSib) + for (pSib = screenInfo.screens[0]->root -> firstChild; pSib; pSib = pSib -> nextSib) { fprintf(stderr, "nxagentCheckWindowConfiguration: Top level window: [%p].\n", (void *) pSib); @@ -3431,7 +3431,7 @@ int nxagentHandleConfigureNotify(XEvent* X) nxagentUpdateViewportFrame(0, 0, nxagentOption(RootWidth), nxagentOption(RootHeight)); - XMoveWindow(nxagentDisplay, nxagentWindow(WindowTable[pScreen -> myNum]), + XMoveWindow(nxagentDisplay, nxagentWindow(pScreen->root), nxagentOption(RootX), nxagentOption(RootY)); } @@ -4245,7 +4245,7 @@ void nxagentForwardRemoteExpose(void) fprintf(stderr, "nxagentForwardRemoteExpose: Going to forward events.\n"); #endif - TraverseTree(WindowTable[0], nxagentClipAndSendExpose, (void *)nxagentRemoteExposeRegion); + TraverseTree(screenInfo.screens[0]->root, nxagentClipAndSendExpose, (void *)nxagentRemoteExposeRegion); /* * Now this region should be empty. @@ -4420,7 +4420,7 @@ int nxagentHandleRRScreenChangeNotify(XEvent *X) nxagentResizeScreen(screenInfo.screens[DefaultScreen(nxagentDisplay)], Xr -> width, Xr -> height, Xr -> mwidth, Xr -> mheight); - nxagentShadowCreateMainWindow(screenInfo.screens[DefaultScreen(nxagentDisplay)], WindowTable[0], + nxagentShadowCreateMainWindow(screenInfo.screens[DefaultScreen(nxagentDisplay)], screenInfo.screens[0]->root, Xr -> width, Xr -> height); nxagentShadowSetWindowsSize(); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index adeaff870..5e89e67bd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -344,13 +344,13 @@ InitSelections() CurrentSelections[0].selection = XA_PRIMARY; CurrentSelections[0].lastTimeChanged = ClientTimeToServerTime(0); - CurrentSelections[0].window = WindowTable[0]->drawable.id; + CurrentSelections[0].window = screenInfo.screens[0]->root->drawable.id; CurrentSelections[0].pWin = NULL; CurrentSelections[0].client = NullClient; CurrentSelections[1].selection = MakeAtom("CLIPBOARD", 9, 1); CurrentSelections[1].lastTimeChanged = ClientTimeToServerTime(0); - CurrentSelections[1].window = WindowTable[0]->drawable.id; + CurrentSelections[1].window = screenInfo.screens[0]->root->drawable.id; CurrentSelections[1].pWin = NULL; CurrentSelections[1].client = NullClient; } @@ -374,8 +374,8 @@ FlushClientCaches(XID id) { if (client->lastDrawableID == id) { - client->lastDrawableID = WindowTable[0]->drawable.id; - client->lastDrawable = (DrawablePtr)WindowTable[0]; + client->lastDrawableID = screenInfo.screens[0]->root->drawable.id; + client->lastDrawable = (DrawablePtr)screenInfo.screens[0]->root; } else if (client->lastGCID == id) { @@ -1161,7 +1161,7 @@ GetGeometry(register ClientPtr client, xGetGeometryReply *rep) rep->type = X_Reply; rep->length = 0; rep->sequenceNumber = client->sequence; - rep->root = WindowTable[pDraw->pScreen->myNum]->drawable.id; + rep->root = pDraw->pScreen->root->drawable.id; rep->depth = pDraw->depth; rep->width = pDraw->width; rep->height = pDraw->height; @@ -1221,7 +1221,7 @@ ProcQueryTree(register ClientPtr client) return(BadWindow); memset(&reply, 0, sizeof(xQueryTreeReply)); reply.type = X_Reply; - reply.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; + reply.root = pWin->drawable.pScreen->root->drawable.id; reply.sequenceNumber = client->sequence; if (pWin->parent) reply.parent = pWin->parent->drawable.id; @@ -4319,8 +4319,8 @@ void InitClient(ClientPtr client, int i, void * ospriv) if (i) { client->closeDownMode = DestroyAll; - client->lastDrawable = (DrawablePtr)WindowTable[0]; - client->lastDrawableID = WindowTable[0]->drawable.id; + client->lastDrawable = (DrawablePtr)screenInfo.screens[0]->root; + client->lastDrawableID = screenInfo.screens[0]->root->drawable.id; } else { @@ -4563,8 +4563,8 @@ SendConnSetup(register ClientPtr client, char *reason) register unsigned int j; register xDepth *pDepth; - root->currentInputMask = WindowTable[i]->eventMask | - wOtherEventMasks (WindowTable[i]); + root->currentInputMask = screenInfo.screens[i]->root->eventMask | + wOtherEventMasks (screenInfo.screens[i]->root); pDepth = (xDepth *)(root + 1); for (j = 0; j < root->nDepths; j++) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c index 89c5c0b19..3142233ac 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c @@ -162,7 +162,6 @@ extern Bool XkbFilterEvents(ClientPtr, int, xEvent *); #endif #ifdef XEVIE -extern WindowPtr *WindowTable; extern int xevieFlag; extern int xevieClientIndex; extern DeviceIntPtr xeviemouse; @@ -465,9 +464,10 @@ XineramaCheckPhysLimits( static Bool XineramaSetWindowPntrs(WindowPtr pWin) { - if(pWin == WindowTable[0]) { - memcpy(sprite.windows, WindowTable, - PanoramiXNumScreens*sizeof(WindowPtr)); + if(pWin == screenInfo.screens[0]->root) { + int i; + for (i = 0; i < PanoramiXNumScreens; i++) + sprite.windows[i] = screenInfo.screens[i]->root; } else { PanoramiXRes *win; int i; @@ -692,7 +692,7 @@ XineramaConfineCursorToWindow(WindowPtr pWin, Bool generateEvents) sprite.hotShape = NullRegion; sprite.confined = FALSE; - sprite.confineWin = (pWin == WindowTable[0]) ? NullWindow : pWin; + sprite.confineWin = (pWin == screenInfo.screens[0]->root) ? NullWindow : pWin; XineramaCheckPhysLimits(sprite.current, generateEvents); } @@ -909,7 +909,7 @@ CheckVirtualMotion( qe->event->u.keyButtonPointer.rootY = sprite.hot.y; } } - ROOT = WindowTable[sprite.hot.pScreen->myNum]; + ROOT = sprite.hot.pScreen->root; } static void @@ -1109,7 +1109,7 @@ EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count) */ if (xE->u.u.type == MotionNotify) XE_KBPTR.root = - WindowTable[sprite.hotPhys.pScreen->myNum]->drawable.id; + sprite.hotPhys.pScreen->root->drawable.id; eventinfo.events = xE; eventinfo.count = count; CallCallbacks(&DeviceEventCallback, (void *)&eventinfo); @@ -1272,7 +1272,7 @@ playmore: ConfineCursorToWindow(grab->confineTo, TRUE, TRUE); } else - ConfineCursorToWindow(WindowTable[sprite.hotPhys.pScreen->myNum], + ConfineCursorToWindow(sprite.hotPhys.pScreen->root, TRUE, FALSE); PostNewCursor(); } @@ -1290,7 +1290,7 @@ ScreenRestructured (ScreenPtr pScreen) ConfineCursorToWindow(grab->confineTo, TRUE, TRUE); } else - ConfineCursorToWindow(WindowTable[sprite.hotPhys.pScreen->myNum], + ConfineCursorToWindow(sprite.hotPhys.pScreen->root, TRUE, FALSE); } #endif @@ -2219,7 +2219,7 @@ CheckMotion(xEvent *xE) if (sprite.hot.pScreen != sprite.hotPhys.pScreen) { sprite.hot.pScreen = sprite.hotPhys.pScreen; - ROOT = WindowTable[sprite.hot.pScreen->myNum]; + ROOT = sprite.hot.pScreen->root; } #ifdef XEVIE xeviehot.x = @@ -2307,9 +2307,9 @@ WindowsRestructured() #ifdef PANORAMIX /* This was added to support reconfiguration under Xdmx. The problem is - * that if the 0th screen (i.e., WindowTable[0]) is moved to an origin - * other than 0,0, the information in the private sprite structure must - * be updated accordingly, or XYToWindow (and other routines) will not + * that if the 0th screen (i.e., screenInfo.screens[0]->root) is moved to + * an origin other than 0,0, the information in the private sprite structure + * must be updated accordingly, or XYToWindow (and other routines) will not * compute correctly. */ void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff) { @@ -2339,7 +2339,7 @@ void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff) sprite.hotPhys.x = sprite.hotPhys.y = 0; ConfineCursorToWindow(grab->confineTo, TRUE, TRUE); } else - ConfineCursorToWindow(WindowTable[sprite.hotPhys.pScreen->myNum], + ConfineCursorToWindow(sprite.hotPhys.pScreen->root, TRUE, FALSE); } #endif @@ -2435,7 +2435,7 @@ NewCurrentScreen(ScreenPtr newScreen, int x, int y) if(sprite.confineWin) XineramaConfineCursorToWindow(sprite.confineWin, TRUE); else - XineramaConfineCursorToWindow(WindowTable[0], TRUE); + XineramaConfineCursorToWindow(screenInfo.screens[0]->root, TRUE); /* if the pointer wasn't confined, the DDX won't get told of the pointer warp so we reposition it here */ if(!syncEvents.playingEvents) @@ -2448,7 +2448,7 @@ NewCurrentScreen(ScreenPtr newScreen, int x, int y) } else #endif if (newScreen != sprite.hotPhys.pScreen) - ConfineCursorToWindow(WindowTable[newScreen->myNum], TRUE, FALSE); + ConfineCursorToWindow(newScreen->root, TRUE, FALSE); } #ifdef PANORAMIX @@ -2520,7 +2520,7 @@ XineramaWarpPointer(ClientPtr client) winX = source->drawable.x; winY = source->drawable.y; - if(source == WindowTable[0]) { + if(source == screenInfo.screens[0]->root) { winX -= panoramiXdataPtr[0].x; winY -= panoramiXdataPtr[0].y; } @@ -2536,7 +2536,7 @@ XineramaWarpPointer(ClientPtr client) if (dest) { x = dest->drawable.x; y = dest->drawable.y; - if(dest == WindowTable[0]) { + if(dest == screenInfo.screens[0]->root) { x -= panoramiXdataPtr[0].x; y -= panoramiXdataPtr[0].y; } @@ -3206,7 +3206,7 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count /* see comment in EnqueueEvents regarding the next three lines */ if (xE->u.u.type == MotionNotify) XE_KBPTR.root = - WindowTable[sprite.hotPhys.pScreen->myNum]->drawable.id; + sprite.hotPhys.pScreen->root->drawable.id; eventinfo.events = xE; eventinfo.count = count; CallCallbacks(&DeviceEventCallback, (void *)&eventinfo); @@ -3818,11 +3818,11 @@ DoFocusEvents(DeviceIntPtr dev, WindowPtr fromWin, WindowPtr toWin, int mode) /* Notify all the roots */ #ifdef PANORAMIX if ( !noPanoramiXExtension ) - FocusEvent(dev, FocusOut, mode, out, WindowTable[0]); + FocusEvent(dev, FocusOut, mode, out, screenInfo.screens[0]->root); else #endif for (i=0; iroot); } else { @@ -3837,11 +3837,11 @@ DoFocusEvents(DeviceIntPtr dev, WindowPtr fromWin, WindowPtr toWin, int mode) /* Notify all the roots */ #ifdef PANORAMIX if ( !noPanoramiXExtension ) - FocusEvent(dev, FocusIn, mode, in, WindowTable[0]); + FocusEvent(dev, FocusIn, mode, in, screenInfo.screens[0]->root); else #endif for (i=0; iroot); if (toWin == PointerRootWin) (void)FocusInEvents(dev, ROOT, sprite.win, NullWindow, mode, NotifyPointer, TRUE); @@ -3855,11 +3855,11 @@ DoFocusEvents(DeviceIntPtr dev, WindowPtr fromWin, WindowPtr toWin, int mode) TRUE); #ifdef PANORAMIX if ( !noPanoramiXExtension ) - FocusEvent(dev, FocusOut, mode, out, WindowTable[0]); + FocusEvent(dev, FocusOut, mode, out, screenInfo.screens[0]->root); else #endif for (i=0; iroot); if (toWin->parent != NullWindow) (void)FocusInEvents(dev, ROOT, toWin, toWin, mode, NotifyNonlinearVirtual, TRUE); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c b/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c index ad75b43f8..a52a5200a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c @@ -504,7 +504,7 @@ miSendExposures(pWin, pRgn, dx, dy) if(!pWin->parent) { x = panoramiXdataPtr[scrnum].x; y = panoramiXdataPtr[scrnum].y; - pWin = WindowTable[0]; + pWin = screenInfo.screens[0]->root; realWin = pWin->drawable.id; } else if (scrnum) { PanoramiXRes *win; @@ -788,7 +788,7 @@ int what; gcmask |= GCFunction | GCClipMask; i = pScreen->myNum; - pRoot = WindowTable[i]; + pRoot = screenInfo.screens[i]->root; pBgWin = pWin; if (what == PW_BORDER) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c index 1999c33b0..238e5a39c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c @@ -3204,7 +3204,7 @@ PanoramiXRenderCreatePicture (ClientPtr client) newPict->info[0].id = stuff->pid; if (refDraw->type == XRT_WINDOW && - stuff->drawable == WindowTable[0]->drawable.id) + stuff->drawable == screenInfo.screens[0]->root->drawable.id) { newPict->u.pict.root = TRUE; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c index 39a1992de..226d20f34 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c @@ -699,8 +699,8 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType) } if(clients[cid] && (id == clients[cid]->lastDrawableID)) { - clients[cid]->lastDrawable = (DrawablePtr)WindowTable[0]; - clients[cid]->lastDrawableID = WindowTable[0]->drawable.id; + clients[cid]->lastDrawable = (DrawablePtr)screenInfo.screens[0]->root; + clients[cid]->lastDrawableID = screenInfo.screens[0]->root->drawable.id; } } if (!gotOne) @@ -740,8 +740,8 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree) } if(clients[cid] && (id == clients[cid]->lastDrawableID)) { - clients[cid]->lastDrawable = (DrawablePtr)WindowTable[0]; - clients[cid]->lastDrawableID = WindowTable[0]->drawable.id; + clients[cid]->lastDrawable = (DrawablePtr)screenInfo.screens[0]->root; + clients[cid]->lastDrawableID = screenInfo.screens[0]->root->drawable.id; } } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c index 70c378b9e..5daa65443 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c @@ -240,7 +240,7 @@ PrintWindowTree() for (i=0; iroot; RegionPrint(&pWin->clipList); p1 = pWin->firstChild; PrintChildren(p1, 4); @@ -286,7 +286,7 @@ TraverseTree(register WindowPtr pWin, VisitWindowProcPtr func, void * data) int WalkTree(ScreenPtr pScreen, VisitWindowProcPtr func, void * data) { - return(TraverseTree(WindowTable[pScreen->myNum], func, data)); + return(TraverseTree(pScreen->root, func, data)); } /* hack for forcing backing store on all windows */ @@ -457,7 +457,9 @@ CreateRootWindow(ScreenPtr pScreen) savedScreenInfo[pScreen->myNum].ExternalScreenSaver = NULL; screenIsSaved = SCREEN_SAVER_OFF; - WindowTable[pScreen->myNum] = pWin; + pScreen->root = pWin; + + pScreen->root = pWin; pWin->drawable.pScreen = pScreen; pWin->drawable.type = DRAWABLE_WINDOW; @@ -583,11 +585,11 @@ InitRootWindow(WindowPtr pWin) /* * A root window is created for each screen by main - * and the pointer is saved in WindowTable as in the - * following snippet: + * and the pointer is saved in screenInfo.screens as + * in the following snippet: * * for (i = 0; i < screenInfo.numScreens; i++) - * InitRootWindow(WindowTable[i]); + * InitRootWindow(screenInfo.screens[i]->root); * * Our root window on the real display was already * created at the time the screen was opened, so it @@ -1583,7 +1585,7 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt */ if ( cursorID == None) { - if (pWin == WindowTable[pWin->drawable.pScreen->myNum]) + if (pWin == pWin->drawable.pScreen->root) pCursor = rootCursor; else pCursor = (CursorPtr) None; @@ -2863,7 +2865,7 @@ ReparentWindow(register WindowPtr pWin, register WindowPtr pParent, pWin->parent = pParent; pPrev = RealChildHead(pParent); - if (pWin->parent == WindowTable[0]) + if (pWin->parent == screenInfo.screens[0]->root) { nxagentSetTopLevelEventMask(pWin); } @@ -3442,7 +3444,7 @@ HandleSaveSet(register ClientPtr client) pWin = SaveSetWindow(client->saveSet[j]); #ifdef XFIXES if (SaveSetToRoot(client->saveSet[j])) - pParent = WindowTable[pWin->drawable.pScreen->myNum]; + pParent = pWin->drawable.pScreen->root; else #endif { @@ -3744,9 +3746,9 @@ TileScreenSaver(int i, int kind) attri = 0; switch (kind) { case SCREEN_IS_TILED: - switch (WindowTable[i]->backgroundState) { + switch (screenInfo.screens[i]->root->backgroundState) { case BackgroundPixel: - attributes[attri++] = WindowTable[i]->background.pixel; + attributes[attri++] = screenInfo.screens[i]->root->background.pixel; mask |= CWBackPixel; break; case BackgroundPixmap: @@ -3758,7 +3760,7 @@ TileScreenSaver(int i, int kind) } break; case SCREEN_IS_BLACK: - attributes[attri++] = WindowTable[i]->drawable.pScreen->blackPixel; + attributes[attri++] = screenInfo.screens[i]->root->drawable.pScreen->blackPixel; mask |= CWBackPixel; break; } @@ -3806,12 +3808,12 @@ TileScreenSaver(int i, int kind) pWin = savedScreenInfo[i].pWindow = CreateWindow(savedScreenInfo[i].wid, - WindowTable[i], + screenInfo.screens[i]->root, -RANDOM_WIDTH, -RANDOM_WIDTH, (unsigned short)screenInfo.screens[i]->width + RANDOM_WIDTH, (unsigned short)screenInfo.screens[i]->height + RANDOM_WIDTH, 0, InputOutput, mask, attributes, 0, serverClient, - wVisual (WindowTable[i]), &result); + wVisual (screenInfo.screens[i]->root), &result); if (cursor) FreeResource (cursorID, RT_NONE); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c index c9f62b1fe..f429f1499 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c @@ -1449,7 +1449,7 @@ Bool nxagentFbOnShadowDisplay() XGCValues value; XImage *image; Visual *pVisual; - WindowPtr pWin = WindowTable[0]; + WindowPtr pWin = screenInfo.screens[0]->root; unsigned int format; int depth, width, height, length; char *data = NULL; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c index a725e20e7..49877f9d7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c @@ -20,6 +20,7 @@ #include "../../include/window.h" #include "windowstr.h" #include "colormapst.h" +#include "scrnintstr.h" #include "propertyst.h" #include "Agent.h" @@ -242,7 +243,7 @@ Bool nxagentRootlessTreesMatch() Window *children_return; unsigned int nChildrenReturn; WindowPtr pW; - WindowPtr pTestWin = WindowTable[0] -> firstChild; + WindowPtr pTestWin = screenInfo.screens[0]->root -> firstChild; Bool treesMatch = True; Status result; @@ -267,7 +268,7 @@ Bool nxagentRootlessTreesMatch() pW = nxagentRootlessTopLevelWindow(children_return[nChildrenReturn]); } - if (pW && pW != WindowTable[0]) + if (pW && pW != screenInfo.screens[0]->root) { if (treesMatch && pTestWin && pTestWin == pW) { @@ -316,7 +317,7 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren) pWin = nxagentRootlessTopLevelWindow(children[i]); } - if (pWin && pWin != WindowTable[0]) + if (pWin && pWin != screenInfo.screens[0]->root) { toplevel[ntoplevel++] = pWin; } @@ -338,14 +339,14 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren) fprintf(stderr, "nxagentRootlessRestack: Internal top level windows before restack:"); - for (pWin = WindowTable[0] -> firstChild; pWin != NULL; pWin = pWin -> nextSib) + for (pWin = screenInfo.screens[0]->root -> firstChild; pWin != NULL; pWin = pWin -> nextSib) { fprintf(stderr, "[%p]\n", pWin); } #endif - pWin = WindowTable[0] -> firstChild; + pWin = screenInfo.screens[0]->root -> firstChild; values[1] = (XID) Above; @@ -381,7 +382,7 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren) fprintf(stderr, "nxagentRootlessRestack: Internal top level windows after restack:"); - for (pWin = WindowTable[0] -> firstChild; pWin != NULL; pWin = pWin -> nextSib) + for (pWin = screenInfo.screens[0]->root -> firstChild; pWin != NULL; pWin = pWin -> nextSib) { fprintf(stderr, "[%p]\n", pWin); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 50d278ed7..a4b39a4fe 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -2116,7 +2116,7 @@ Bool nxagentCloseScreen(int index, ScreenPtr pScreen) static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable) { - WindowPtr pWin = WindowTable[pScreen->myNum]; + WindowPtr pWin = pScreen->root; WindowPtr pChild; Bool WasViewable = (Bool)(pWin->viewable); Bool anyMarked = FALSE; @@ -2409,21 +2409,21 @@ FIXME: We should try to restore the previously box.x2 = width; box.y2 = height; - WindowTable[pScreen -> myNum] -> drawable.width = width; - WindowTable[pScreen -> myNum] -> drawable.height = height; - WindowTable[pScreen -> myNum] -> drawable.x = 0; - WindowTable[pScreen -> myNum] -> drawable.y = 0; + pScreen->root -> drawable.width = width; + pScreen->root -> drawable.height = height; + pScreen->root -> drawable.x = 0; + pScreen->root -> drawable.y = 0; - RegionInit(&WindowTable[pScreen -> myNum] -> borderSize, &box, 1); - RegionInit(&WindowTable[pScreen -> myNum] -> winSize, &box, 1); - RegionInit(&WindowTable[pScreen -> myNum] -> clipList, &box, 1); - RegionInit(&WindowTable[pScreen -> myNum] -> borderClip, &box, 1); + RegionInit(&pScreen->root -> borderSize, &box, 1); + RegionInit(&pScreen->root -> winSize, &box, 1); + RegionInit(&pScreen->root -> clipList, &box, 1); + RegionInit(&pScreen->root -> borderClip, &box, 1); - (*pScreen -> PositionWindow)(WindowTable[pScreen -> myNum], 0, 0); + (*pScreen -> PositionWindow)(pScreen->root, 0, 0); nxagentSetRootClip(pScreen, 1); - XMoveWindow(nxagentDisplay, nxagentWindow(WindowTable[0]), + XMoveWindow(nxagentDisplay, nxagentWindow(screenInfo.screens[0]->root), nxagentOption(RootX), nxagentOption(RootY)); nxagentMoveViewport(pScreen, 0, 0); @@ -3522,7 +3522,7 @@ FIXME: The port information is not used at the moment and produces a { mcop_local_atom = MakeAtom(mcop_atom, strlen(mcop_atom), 1); - ChangeWindowProperty(WindowTable[pScreen->myNum], + ChangeWindowProperty(pScreen->root, mcop_local_atom, XA_STRING, iReturnFormat, PropModeReplace, @@ -3667,9 +3667,9 @@ int nxagentChangeScreenConfig(int screen, int width, int height, int mmWidth, in int r; #ifdef TEST - fprintf(stderr, "nxagentChangeScreenConfig: WindowTable[%d] is %p\n", screen, WindowTable[screen]); + fprintf(stderr, "nxagentChangeScreenConfig: screenInfo.screens[%d]->root is %p\n", screen, screenInfo.screens[screen]); #endif - if (WindowTable[screen] == NULL) + if (screenInfo.screens[screen]->root == NULL) { return 0; } @@ -3692,7 +3692,7 @@ int nxagentChangeScreenConfig(int screen, int width, int height, int mmWidth, in return 0; } - pScreen = WindowTable[screen] -> drawable.pScreen; + pScreen = screenInfo.screens[screen] -> root -> drawable.pScreen; #ifdef TEST fprintf(stderr, "nxagentChangeScreenConfig: Changing config to %dx%d.\n", width, height); @@ -4124,7 +4124,7 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg, values.subwindow_mode = IncludeInferiors; - gc = XCreateGC(nxagentDisplay, nxagentWindow(WindowTable[0]), GCSubwindowMode, &values); + gc = XCreateGC(nxagentDisplay, nxagentWindow(screenInfo.screens[0]->root), GCSubwindowMode, &values); /* * Initialize to the corrupted region. @@ -4234,7 +4234,7 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, */ RegionIntersect(prgnRestore, prgnRestore, - &WindowTable[pWin -> drawable.pScreen -> myNum] -> winSize); + &pWin -> drawable.pScreen -> root -> winSize); pBackingStore = (miBSWindowPtr) pWin -> backStorage; @@ -4245,7 +4245,7 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, values.subwindow_mode = ClipByChildren; - gc = XCreateGC(nxagentDisplay, nxagentWindow(WindowTable[0]), GCSubwindowMode, &values); + gc = XCreateGC(nxagentDisplay, nxagentWindow(screenInfo.screens[0]->root), GCSubwindowMode, &values); /* * Translate the reference point to the origin of the window. @@ -4406,7 +4406,7 @@ void nxagentShadowAdaptToRatio(void) nxagentShadowSetRatio(nxagentOption(Width) * 1.0 / nxagentShadowWidth, nxagentOption(Height) * 1.0 / nxagentShadowHeight); - nxagentShadowCreateMainWindow(pScreen, WindowTable[0], nxagentShadowWidth, nxagentShadowHeight); + nxagentShadowCreateMainWindow(pScreen, screenInfo.screens[0]->root, nxagentShadowWidth, nxagentShadowHeight); sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); @@ -4456,7 +4456,7 @@ void nxagentShowPixmap(PixmapPtr pPixmap, int x, int y, int width, int height) XlibGC gc; XGCValues value; XImage *image; - WindowPtr pWin = WindowTable[0]; + WindowPtr pWin = screenInfo.screens[0]->root; unsigned int format; int depth, pixmapWidth, pixmapHeight, length; char *data; @@ -4668,7 +4668,7 @@ FIXME value.fill_style = FillSolid; value.function = GXcopy; - gc = XCreateGC(shadow, nxagentWindow(WindowTable[0]), GCBackground | + gc = XCreateGC(shadow, nxagentWindow(screenInfo.screens[0]->root), GCBackground | GCForeground | GCFillStyle | GCPlaneMask | GCFunction, &value); NXCleanImage(image); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Splash.c b/nx-X11/programs/Xserver/hw/nxagent/Splash.c index a069b3e23..35cb7cea9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Splash.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Splash.c @@ -396,15 +396,15 @@ void nxagentRemoveSplashWindow(WindowPtr pWin) XDestroyWindow(nxagentDisplay, nxagentSplashWindow); nxagentSplashWindow = None; - nxagentRefreshWindows(WindowTable[0]); + nxagentRefreshWindows(screenInfo.screens[0]->root); #ifdef TEST fprintf(stderr, "nxagentRemoveSplashWindow: setting the ownership of %s (%d) on window 0x%lx\n", - "NX_CUT_BUFFER_SERVER", (int)serverCutProperty, nxagentWindow(WindowTable[0])); + "NX_CUT_BUFFER_SERVER", (int)serverCutProperty, nxagentWindow(screenInfo.screens[0]->root)); #endif XSetSelectionOwner(nxagentDisplay, serverCutProperty, - nxagentWindow(WindowTable[0]), CurrentTime); + nxagentWindow(screenInfo.screens[0]->root), CurrentTime); } if (nxagentPixmapLogo) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index b553627dd..514ee5140 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -196,7 +196,7 @@ static Bool nxagentCheckWindowIntegrity(WindowPtr pWin); WindowPtr nxagentGetWindowFromID(Window id) { - WindowPtr pWin = WindowTable[0]; + WindowPtr pWin = screenInfo.screens[0]->root; while (pWin && nxagentWindowPriv(pWin)) { @@ -508,7 +508,7 @@ FIXME: Do all the windows for which nxagentWindowTopLevel(pWin) Bool nxagentSomeWindowsAreMapped() { - WindowPtr pWin = WindowTable[0] -> firstChild; + WindowPtr pWin = screenInfo.screens[0]->root -> firstChild; while (pWin) { @@ -884,7 +884,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) nxagentUpdateViewportFrame(0, 0, nxagentOption(RootWidth), nxagentOption(RootHeight)); - XMoveWindow(nxagentDisplay, nxagentWindow(WindowTable[pScreen -> myNum]), + XMoveWindow(nxagentDisplay, nxagentWindow(pScreen->root), nxagentOption(RootX), nxagentOption(RootY)); /* @@ -995,7 +995,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) nxagentUpdateViewportFrame(0, 0, nxagentOption(Width), nxagentOption(Height)); - XMoveWindow(nxagentDisplay, nxagentWindow(WindowTable[pScreen -> myNum]), 0, 0); + XMoveWindow(nxagentDisplay, nxagentWindow(pScreen->root), 0, 0); XMapWindow(nxagentDisplay, w); nxagentChangeOption(RootX, 0); @@ -1156,11 +1156,11 @@ void nxagentMoveViewport(ScreenPtr pScreen, int hShift, int vShift) -nxagentOption(RootY) + nxagentOption(Height)); fprintf(stderr, "nxagentMoveViewport: Root geometry x=[%d] y=[%d]\n", - WindowTable[pScreen -> myNum] -> drawable.x, - WindowTable[pScreen -> myNum] -> drawable.y ); + pScreen->root -> drawable.x, + pScreen->root -> drawable.y ); #endif - XMoveWindow(nxagentDisplay, nxagentWindow(WindowTable[pScreen -> myNum]), + XMoveWindow(nxagentDisplay, nxagentWindow(pScreen->root), nxagentOption(RootX), nxagentOption(RootY)); if (nxagentOption(ClientOs) == ClientOsWinnt) @@ -2437,7 +2437,7 @@ static int nxagentForceExposure(WindowPtr pWin, void * ptr) { RegionPtr exposedRgn; BoxRec Box; - WindowPtr pRoot = WindowTable[pWin->drawable.pScreen->myNum]; + WindowPtr pRoot = pWin->drawable.pScreen->root; if (pWin -> drawable.class != InputOnly) { @@ -2491,7 +2491,7 @@ void nxagentMapDefaultWindows() for (i = 0; i < screenInfo.numScreens; i++) { - WindowPtr pWin = WindowTable[i]; + WindowPtr pWin = screenInfo.screens[i]->root; ScreenPtr pScreen = pWin -> drawable.pScreen; @@ -2606,7 +2606,7 @@ Bool nxagentDisconnectAllWindows(void) for (i = 0; i < screenInfo.numScreens; i++) { - pWin = WindowTable[i]; + pWin = screenInfo.screens[i]->root; nxagentTraverseWindow( pWin, nxagentDisconnectWindow, &succeded); nxagentDefaultWindows[i] = None; } @@ -2684,16 +2684,16 @@ Bool nxagentReconnectAllWindows(void *p0) fprintf(stderr, "nxagentReconnectAllWindows\n"); #endif - if (WindowTable[0] -> backgroundState == BackgroundPixmap && - WindowTable[0] -> background.pixmap == NULL) + if (screenInfo.screens[0]->root -> backgroundState == BackgroundPixmap && + screenInfo.screens[0]->root -> background.pixmap == NULL) { FatalError("nxagentReconnectAllWindows: correct the FIXME\n"); } if (nxagentOption(Fullscreen)) { - WindowTable[0] -> origin.x = nxagentOption(RootX); - WindowTable[0] -> origin.y = nxagentOption(RootY); + screenInfo.screens[0]->root -> origin.x = nxagentOption(RootX); + screenInfo.screens[0]->root -> origin.y = nxagentOption(RootY); } if (!nxagentLoopOverWindows(nxagentReconnectWindow)) @@ -2739,8 +2739,8 @@ Bool nxagentReconnectAllWindows(void *p0) if (nxagentOption(Fullscreen)) { - WindowTable[0] -> origin.x = 0; - WindowTable[0] -> origin.y = 0; + screenInfo.screens[0]->root -> origin.x = 0; + screenInfo.screens[0]->root -> origin.y = 0; } #ifdef NXAGENT_RECONNECT_WINDOW_DEBUG @@ -2751,7 +2751,7 @@ Bool nxagentReconnectAllWindows(void *p0) #endif - if (nxagentInitClipboard(WindowTable[0]) == -1) + if (nxagentInitClipboard(screenInfo.screens[0]->root) == -1) { #ifdef WARNING fprintf(stderr, "nxagentReconnectAllWindows: WARNING! Couldn't initialize the clipboard.\n"); @@ -2848,7 +2848,7 @@ static Bool nxagentLoopOverWindows(void (*pF)(void *, XID, void *)) for (i = 0; i < screenInfo.numScreens; i++) { - pWin = WindowTable[i]; + pWin = screenInfo.screens[i]->root; nxagentTraverseWindow(pWin, pF, &windowSuccess); } @@ -2995,7 +2995,7 @@ FIXME: Do we need to set save unders attribute here? * if a client handles this. */ - if (nxagentOption(Rootless) && (pWin != WindowTable[0])) + if (nxagentOption(Rootless) && (pWin != screenInfo.screens[0]->root)) { if (nxagentWindowTopLevel(pWin)) { @@ -3196,7 +3196,7 @@ static void nxagentReconfigureWindow(void * param0, XID param1, void * data_buff nxagentShapeWindow(pWin); #endif - if (pWin != WindowTable[0]) + if (pWin != screenInfo.screens[0]->root) { if (pWin->realized) { @@ -3238,7 +3238,7 @@ Bool nxagentCheckIllegalRootMonitoring(WindowPtr pWin, Mask mask) Mask invalidMask = SubstructureRedirectMask | ResizeRedirectMask | ButtonPressMask; if (nxagentOption(Rootless) && - pWin == WindowTable[0] && + pWin == screenInfo.screens[0]->root && (mask & invalidMask)) { return True; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Windows.h b/nx-X11/programs/Xserver/hw/nxagent/Windows.h index 3ca74ba8e..dedb60299 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Windows.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Windows.h @@ -167,7 +167,7 @@ extern int nxagentWindowPrivateIndex; #define nxagentRefreshScreen() \ do\ {\ - nxagentRefreshWindows(WindowTable[0]);\ + nxagentRefreshWindows(screenInfo.screens[0]->root);\ } while (0) WindowPtr nxagentWindowPtr(Window window); -- cgit v1.2.3 From 8c7d7bed969e556aa038aa2d45c7c9697dda9de9 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 20 Jun 2016 16:51:59 +0200 Subject: hw/nxagent/NXresource.c: remove caching of drawables and graphics contexts. The security checks simply bypass the cached values so they are unused. Required code de-duplication in nxagent. (Will be fixed by ArcticaProject/nx-libs#120 later on). --- nx-X11/programs/Xserver/hw/nxagent/NXresource.c | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent') diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c index 226d20f34..96bbde00c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c @@ -685,8 +685,6 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType) #ifdef NXAGENT_SERVER nxagentResChangedFlag = 1; #endif - if (rtype & RC_CACHED) - FlushClientCaches(res->id); if (rtype != skipDeleteFuncType) (*DeleteFuncs[rtype & TypeMask])(res->value, res->id); xfree(res); @@ -697,11 +695,6 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType) else prev = &res->next; } - if(clients[cid] && (id == clients[cid]->lastDrawableID)) - { - clients[cid]->lastDrawable = (DrawablePtr)screenInfo.screens[0]->root; - clients[cid]->lastDrawableID = screenInfo.screens[0]->root->drawable.id; - } } if (!gotOne) ErrorF("Freeing resource id=%lX which isn't there.\n", @@ -728,8 +721,6 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree) #ifdef NXAGENT_SERVER nxagentResChangedFlag = 1; #endif - if (type & RC_CACHED) - FlushClientCaches(res->id); if (!skipFree) (*DeleteFuncs[type & TypeMask])(res->value, res->id); xfree(res); @@ -738,11 +729,6 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree) else prev = &res->next; } - if(clients[cid] && (id == clients[cid]->lastDrawableID)) - { - clients[cid]->lastDrawable = (DrawablePtr)screenInfo.screens[0]->root; - clients[cid]->lastDrawableID = screenInfo.screens[0]->root->drawable.id; - } } } @@ -765,8 +751,6 @@ ChangeResourceValue (XID id, RESTYPE rtype, void * value) for (; res; res = res->next) if ((res->id == id) && (res->type == rtype)) { - if (rtype & RC_CACHED) - FlushClientCaches(res->id); res->value = value; return TRUE; } @@ -1027,8 +1011,6 @@ FreeClientNeverRetainResources(ClientPtr client) if (rtype & RC_NEVERRETAIN) { *prev = this->next; - if (rtype & RC_CACHED) - FlushClientCaches(this->id); (*DeleteFuncs[rtype & TypeMask])(this->value, this->id); xfree(this); } @@ -1073,8 +1055,6 @@ FreeClientResources(ClientPtr client) { RESTYPE rtype = this->type; *head = this->next; - if (rtype & RC_CACHED) - FlushClientCaches(this->id); (*DeleteFuncs[rtype & TypeMask])(this->value, this->id); xfree(this); } -- cgit v1.2.3 From 21c3d20fb3e425206b0af228e9ebca6d0566afa4 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 20 Jun 2016 13:19:08 +0200 Subject: [render] Split out filter finding from filter setting. Backported from X.org: commit acda790e430b2a18c7c35379f6e538f3d01ff221 Author: Keith Packard Date: Fri Mar 14 13:46:30 2008 -0700 [render] Split out filter finding from filter setting. To prepare for RandR using filters in transforms, split out code paths so that the RandR code can validate the filter name and parameters during the transform set operation so that use of the filter later will not have unreportable errors. Backport to nx-libs: Mike Gabriel --- nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent') diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h b/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h index b1e56ad25..75e051ce1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h @@ -482,7 +482,12 @@ PictFilterPtr PictureFindFilter (ScreenPtr pScreen, char *name, int len); int -SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int nparams); +SetPicturePictFilter (PicturePtr pPicture, PictFilterPtr pFilter, + xFixed *params, int nparams); + +int +SetPictureFilter (PicturePtr pPicture, char *name, int len, + xFixed *params, int nparams); Bool PictureFinishInit (void); -- cgit v1.2.3 From f9dbc64f0e3c558f9313c3cb87ebee01fe3287cd Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 20 Jun 2016 15:43:35 +0200 Subject: Move matrix operations from X server to pixman 0.13.2, handle RandR transform matrices in floating point. Backported from X.org, inspired by: commit 9ffc6719390df8fdd0a5295a7a7a0eaea792be45 Author: Keith Packard Date: Mon Nov 24 13:08:48 2008 -0800 Move matrix operations from X server to pixman 0.13.2 pixman 0.13.2 now holds all of the matrix operations. This leaves the protocol conversion routines and some ABI stubs in place Signed-off-by: Keith Packard commit c4b9ab6bf56139fdd8c7c584a6f523c6766cddd6 Author: Keith Packard Date: Tue Apr 29 08:29:42 2008 -0700 Handle transform failure when computing shadow damage area. PictureTransformBounds can fail, when this happens, damage the entire screen so that the shadow gets repainted correctly. commit fa6a1df209bd74da1d545982cca437afc2198cc1 Author: Keith Packard Date: Fri Mar 21 02:35:28 2008 -0700 Avoid overflow in PictureTransformPoint. Fix PictureTransformIsIdentity. PictureTransformPoint computes homogeneous coordinates internally, but fails to handle intermediate values larger than 16.16. Use 64 bit intermediate values while computing the final result at 16.16 and only complain if that result is too large. PictureTransformIsIdentity was completely wrong -- it was not checking for identity transforms at all. commit 49db14e4ac26070ed86088419483888dda18b603 Author: Keith Packard Date: Wed Mar 19 00:46:35 2008 -0700 Handle RandR transform matrices in floating point. RandR matrix computations lose too much precision in fixed point; computations using the inverted matrix can be as much as 10 pixels off. Convert them to double precision values and pass those around. These API changes are fairly heavyweight; the official Render interface remains fixed point, so the fixed point matrix comes along for the ride everywhere. commit 97ab0c6eff870b52c0383b63a78cec49059b2545 Author: Keith Packard Date: Tue Mar 18 15:15:40 2008 -0700 When converting from double to fixed, round carefully. This reduces the matrix representation error after inverting a transformation matrix (although it doesn't eliminate it entirely). Perhaps we should extend Render to include 64-bit floating point transforms... commit 160252d94f04acc95f0a4e0f884ff565a5aa0744 Author: Keith Packard Date: Mon Mar 17 23:03:56 2008 -0700 Add matrix inversion function (uses doubles) The obvious matrix inversion function, coded using doubles to avoid fiddling with fixed point precision adventures. commit ff9d1cd843a9b0aba69a3d788b21d5f6af702590 Author: Keith Packard Date: Thu Mar 13 21:30:18 2008 -0700 Add funcs to convert between protocol and pixman matrices commit f547650328287545a7a4d96df8d6a6c606dd95a9 Author: Keith Packard Date: Thu Mar 13 14:50:13 2008 -0700 Export a bunch of matrix operations from render. The render extension uses many matrix operations internally, this change exposes those functions to other parts of the server, drivers and extensions. The change is motivated by the 'transform' additions to the RandR extension but will likely be useful elsewhere. Backport to nx-libs: Mike Gabriel --- nx-X11/programs/Xserver/hw/nxagent/NXpicture.c | 68 ----------------------- nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h | 18 ++++++ 2 files changed, 18 insertions(+), 68 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent') diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c index 5087fa493..10111adec 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c @@ -2051,74 +2051,6 @@ AddTraps (PicturePtr pPicture, (*ps->AddTraps) (pPicture, xOff, yOff, ntrap, traps); } -#define MAX_FIXED_48_16 ((xFixed_48_16) 0x7fffffff) -#define MIN_FIXED_48_16 (-((xFixed_48_16) 1 << 31)) - -Bool -PictureTransformPoint3d (PictTransformPtr transform, - PictVectorPtr vector) -{ - PictVector result; - int i, j; - xFixed_32_32 partial; - xFixed_48_16 v; - - for (j = 0; j < 3; j++) - { - v = 0; - for (i = 0; i < 3; i++) - { - partial = ((xFixed_48_16) transform->matrix[j][i] * - (xFixed_48_16) vector->vector[i]); - v += partial >> 16; - } - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - result.vector[j] = (xFixed) v; - } - if (!result.vector[2]) - return FALSE; - *vector = result; - return TRUE; -} - - -Bool -PictureTransformPoint (PictTransformPtr transform, - PictVectorPtr vector) -{ - PictVector result; - int i, j; - xFixed_32_32 partial; - xFixed_48_16 v; - - for (j = 0; j < 3; j++) - { - v = 0; - for (i = 0; i < 3; i++) - { - partial = ((xFixed_48_16) transform->matrix[j][i] * - (xFixed_48_16) vector->vector[i]); - v += partial >> 16; - } - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - result.vector[j] = (xFixed) v; - } - if (!result.vector[2]) - return FALSE; - for (j = 0; j < 2; j++) - { - partial = (xFixed_48_16) result.vector[j] << 16; - v = partial / result.vector[2]; - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - vector->vector[j] = (xFixed) v; - } - vector->vector[2] = xFixed1; - return TRUE; -} - #ifndef True # define True 1 #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h b/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h index 75e051ce1..68fe80c37 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h @@ -687,4 +687,22 @@ void PanoramiXRenderInit (void); void PanoramiXRenderReset (void); #endif +/* + * matrix.c + */ + +extern _X_EXPORT void +PictTransform_from_xRenderTransform(PictTransformPtr pict, + xRenderTransform * render); + +extern _X_EXPORT void +xRenderTransform_from_PictTransform(xRenderTransform * render, + PictTransformPtr pict); + +extern _X_EXPORT Bool + PictureTransformPoint(PictTransformPtr transform, PictVectorPtr vector); + +extern _X_EXPORT Bool + PictureTransformPoint3d(PictTransformPtr transform, PictVectorPtr vector); + #endif /* _PICTURESTR_H_ */ -- cgit v1.2.3 From 36e17bdc6eef7107f4a64d9fa4da005da23df519 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 20 Jun 2016 15:51:55 +0200 Subject: [render] Split out filter finding from filter setting. Required code de-duplication in nxagent. (Will be fixed by ArcticaProject/nx-libs#120 later on). --- nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent') diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h b/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h index 68fe80c37..74d03f745 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h @@ -193,12 +193,14 @@ typedef struct _Picture { SourcePictPtr pSourcePict; } PictureRec; -typedef Bool (*PictFilterValidateParamsProcPtr) (PicturePtr pPicture, int id, - xFixed *params, int nparams); +typedef Bool (*PictFilterValidateParamsProcPtr) (ScreenPtr pScreen, int id, + xFixed *params, int nparams, + int *width, int *height); typedef struct { char *name; int id; PictFilterValidateParamsProcPtr ValidateParams; + int width, height; } PictFilterRec, *PictFilterPtr; #define PictFilterNearest 0 -- cgit v1.2.3 From 2e5b98986ffe9de86d7329304ead298c164340bf Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 20 Jun 2016 15:53:20 +0200 Subject: Move matrix operations from X server to pixman 0.13.2. Required code de-duplication in nxagent. (Will be fixed by ArcticaProject/nx-libs#120 later on). --- nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent') diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h b/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h index 74d03f745..30e1005c2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h @@ -78,13 +78,10 @@ typedef struct _PictFormat { IndexFormatRec index; } PictFormatRec; -typedef struct _PictVector { - xFixed vector[3]; -} PictVector, *PictVectorPtr; +typedef struct pixman_vector PictVector, *PictVectorPtr; +typedef struct pixman_transform PictTransform, *PictTransformPtr; -typedef struct _PictTransform { - xFixed matrix[3][3]; -} PictTransform, *PictTransformPtr; +#define pict_f_transform pixman_f_transform #define PICT_GRADIENT_STOPTABLE_SIZE 1024 #define SourcePictTypeSolidFill 0 -- cgit v1.2.3 From c2b1f489d7998c83af73c7cb25bbb2bc53f26094 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 20 Jun 2016 11:10:06 +0200 Subject: Backport RANDR proto version 1.5 to nx-X11's Xserver. Backported to X.org's /xorg/xserver Git hash level: a6b6e8ba026acedef6336b17adf06aebddd5f22f. --- nx-X11/programs/Xserver/hw/nxagent/Extensions.c | 114 +++++++++++++++++++++++- nx-X11/programs/Xserver/hw/nxagent/Imakefile | 7 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 2 +- 3 files changed, 116 insertions(+), 7 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c index dfa511448..494027927 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c @@ -35,6 +35,32 @@ static int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, static int nxagentRandRInitSizes(ScreenPtr pScreen); +#if RANDR_14_INTERFACE +static Bool +nxagentRandRReplaceScanoutPixmap(DrawablePtr pDrawable, + PixmapPtr pPixmap, + Bool enable); +#endif + +#if RANDR_13_INTERFACE +static Bool +nxagentRandROutputGetProperty(ScreenPtr pScreen, + RROutputPtr output, + Atom property); +static Bool +nxagentRandRGetPanning(ScreenPtr pScrn, + RRCrtcPtr crtc, + BoxPtr totalArea, + BoxPtr trackingArea, + INT16 *border); +static Bool +nxagentRandRSetPanning(ScreenPtr pScrn, + RRCrtcPtr crtc, + BoxPtr totalArea, + BoxPtr trackingArea, + INT16 *border); +#endif + #if RANDR_12_INTERFACE static Bool nxagentRandRCrtcSet (ScreenPtr pScreen, RRCrtcPtr crtc, RRModePtr mode, int x, int y, @@ -104,6 +130,29 @@ void nxagentInitRandRExtension(ScreenPtr pScreen) pRandRScrPriv -> rrGetInfo = nxagentRandRGetInfo; + #if RANDR_15_INTERFACE + /* nothing to be assigned here, so far */ + #endif + + #if RANDR_14_INTERFACE + /* no pixmap sharing in nx-X11 */ + pScreen->ReplaceScanoutPixmap = nxagentRandRReplaceScanoutPixmap; + pRandRScrPriv -> rrCrtcSetScanoutPixmap = NULL; + + /* only fake provider support in nx-X11, so far */ + pRandRScrPriv -> provider = RRProviderCreate(pScreen, "default", 7); + pRandRScrPriv -> rrProviderSetOutputSource = NULL; + pRandRScrPriv -> rrProviderSetOffloadSink; + pRandRScrPriv -> rrProviderGetProperty; + pRandRScrPriv -> rrProviderSetProperty; + #endif + + #if RANDR_13_INTERFACE + pRandRScrPriv -> rrOutputGetProperty = nxagentRandROutputGetProperty; + pRandRScrPriv -> rrGetPanning = nxagentRandRGetPanning; + pRandRScrPriv -> rrSetPanning = nxagentRandRSetPanning; + #endif + #if RANDR_12_INTERFACE pRandRScrPriv -> rrScreenSetSize = nxagentRandRScreenSetSize; pRandRScrPriv -> rrCrtcSet = nxagentRandRCrtcSet; @@ -114,13 +163,70 @@ void nxagentInitRandRExtension(ScreenPtr pScreen) #endif } -void -RRResetProc (ExtensionEntry *extEntry) +#if RANDR_14_INTERFACE +static Bool +nxagentRandRReplaceScanoutPixmap(DrawablePtr pDrawable, + PixmapPtr pPixmap, + Bool enable) +{ + /* FALSE means: not supported */ +#ifdef DEBUG + fprintf(stderr, "nxagentRandRReplaceScanoutPixmap: NX's RANDR does not support scan-out pixmaps.\n"); +#endif + return FALSE; +} +#endif + +#if RANDR_13_INTERFACE +static Bool +nxagentRandROutputGetProperty(ScreenPtr pScreen, + RROutputPtr output, + Atom property) { - fprintf(stderr, "RANDR going down - NX version\n"); + /* FALSE means: no property required to be modified on the fly here */ + return FALSE; } +static Bool +nxagentRandRGetPanning(ScreenPtr pScrn, + RRCrtcPtr crtc, + BoxPtr totalArea, + BoxPtr trackingArea, + INT16 *border) +{ + /* FALSE means: no, panning is not supported at the moment... + * Panning requires several modes to be available for + * the NX output(s). + * + * FIXME: Add more modes per output than the current window size. + * At least when in fullscreen mode. + */ +#ifdef DEBUG + fprintf(stderr, "nxagentRandRGetPanning: RANDR Panning is currently not supported.\n"); +#endif + return FALSE; +} +static Bool +nxagentRandRSetPanning(ScreenPtr pScrn, + RRCrtcPtr crtc, + BoxPtr totalArea, + BoxPtr trackingArea, + INT16 *border) +{ + /* FALSE means: no, panning is not supported at the moment... + * Panning requires several modes to be available for + * the NX output(s). + * + * FIXME: Add more modes per output than the current window size. + * At least when in fullscreen mode. + */ +#ifdef DEBUG + fprintf(stderr, "nxagentRandRSetPanning: RANDR Panning is currently not supported.\n"); +#endif + return FALSE; +} +#endif #if RANDR_12_INTERFACE /* @@ -137,7 +243,7 @@ nxagentRandRCrtcSet (ScreenPtr pScreen, int numOutputs, RROutputPtr *outputs) { - return RRCrtcNotify(crtc, mode, x, y, rotation, numOutputs, outputs); + return RRCrtcNotify(crtc, mode, x, y, rotation, NULL, numOutputs, outputs); } #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile index e9cef5ae3..121a1c774 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile +++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile @@ -209,8 +209,11 @@ DEFINES = -g $(OS_DEFINES) $(EXT_DEFINES) $(NX_DEFINES) \ -DNXAGENT_ARTSD \ -DNXAGENT_RANDR_MODE_PREFIX \ -UNX_DEBUG_INPUT \ - -DRANDR_10_INTERFACE \ - -DRANDR_12_INTERFACE \ + -DRANDR_10_INTERFACE=1 \ + -DRANDR_12_INTERFACE=1 \ + -DRANDR_13_INTERFACE=1 \ + -DRANDR_14_INTERFACE=1 \ + -DRANDR_15_INTERFACE=1 \ -DPANORAMIX \ -UDEBUG_TREE diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index a4b39a4fe..40b1e5222 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -3793,7 +3793,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen) * do this here it will be done implicitely later and add mode(s) to * our crtc(s)! */ - rrgetinfo = RRGetInfo(pScreen); + rrgetinfo = RRGetInfo(pScreen, FALSE); fprintf(stderr, "nxagentAdjustRandRXinerama: RRGetInfo returned [%d]\n", rrgetinfo); } -- cgit v1.2.3