diff options
author | Reinhard Tartler <siretart@tauware.de> | 2011-10-10 17:58:56 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2011-10-10 17:58:56 +0200 |
commit | 45b970f25634519dac302a5691a7a2d45f8db49f (patch) | |
tree | f4d55bce7b5701a154f4f61d64cbcf461312a357 /nx-X11/programs/Xserver/hw/nxagent | |
parent | 22914447019845ba3ba238e5814b59939e744f19 (diff) | |
download | nx-libs-45b970f25634519dac302a5691a7a2d45f8db49f.tar.gz nx-libs-45b970f25634519dac302a5691a7a2d45f8db49f.tar.bz2 nx-libs-45b970f25634519dac302a5691a7a2d45f8db49f.zip |
Imported nxagent-3.3.0-6.tar.gznxagent/3.3.0-6
Summary: Imported nxagent-3.3.0-6.tar.gz
Keywords:
Imported nxagent-3.3.0-6.tar.gz
into Git repository
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent')
25 files changed, 214 insertions, 1539 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG b/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG index 1adbcb938..17b69c3f2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG +++ b/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG @@ -1,96 +1,5 @@ ChangeLog: -nxagent-3.3.0-18 - -- The area to restore from the backing store is limited by the screen - size instead of the visible screen. - -nxagent-3.3.0-17 - -- Fixed TR12F02150. The agent could crash when copying text from VNC - viewer. Fixed by aborting the procedure in case the retrieved pro- - perty has not a valid format. - -nxagent-3.3.0-16 - -- Fixed TR07G02247. Don't try to call XSetWindowColormap() if the - window has no colormap, e.g. if its class is InputOnly. - -nxagent-3.3.0-15 - -- Fixed TR04G02210. Region is cut to the visible screen before re- - storing areas from the backing store. - -- Fixed TR07G02246. Box is shrinked if bounds can't stay in a short - signed integer. - -nxagent-3.3.0-14 - -- Fixed TR03G02206. waitpid() call was missing for the "Fonts replace- - ment" dialog type. - -- Fixed TR03G02195. Added a properties structure compatible with 32 - and 64 bit platform types. - -nxagent-3.3.0-13 - -- Handle the window unmap immediately. Don't add it to the configure - queue. - -nxagent-3.3.0-12 - -- Fixed TR03G02200. Timestamps could be in the future in KeyRelease - events sent to the X clients. - -- Added debug logging of input devices state Logging can be enabled - or disabled via the Ctrl+Alt+x shortcut. State info is dumped every - 5 seconds. - -- Added Ctrl+Alt+y shortcut used to deactivate input devices grab for - debug purposes. - -nxagent-3.3.0-11 - -- Changed the message logging the screen size changes, in order to - show the fullscreen state. - -- Handle the window unmapping in the nxagentConfigureWindow queue. - -nxagent-3.3.0-10 - -- Fixed TR12F02146. Compare the drawable and the bitmap data before - realizing the image update, in order to delay the data clean up that - caused the memcmp() failure. - -- Fixed TR01G02156. Reduce the exposing area by subtracting the ex- - posed region. - -- Fixed a compile warning in Drawable.c. - -- Added detailed logs in the nxagentSynchronizeRegion() function if - the data memory allocation fails. - -nxagent-3.3.0-9 - -- Added /usr/NX/share/base to alternate font paths. This would fix - TR11F02130 if fonts fixed and cursor are installed there. - -- Changed Keyboard initialization and reset. This change should fix - TR11F02129, TR11F02131, TR11F02132. - -nxagent-3.3.0-8 - -- Fixed TR12F02144. Image bits of render glyphs are copied before they - are cleaned. This will avoid a memory corruption. - -- Fixed TR12F02145. When dispatching a MotionNotify event, check if a - top-level window has been entered before trying to show the pulldown - dialog. - -nxagent-3.3.0-7 - -- Added debug code for pointer input. - nxagent-3.3.0-6 - Fixed compile warnings. diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index febfe708d..a575cabe5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -680,30 +680,6 @@ void nxagentCollectPropertyEvent(int resource) return; } - - if (resultFormat != 8 && resultFormat != 16 && resultFormat != 32) - { - - #ifdef DEBUG - fprintf (stderr, "nxagentCollectPropertyEvent: WARNING! Invalid property " - "value.\n"); - #endif - - if (lastClientClientPtr != NULL) - { - nxagentSendSelectionNotify(None); - } - - lastClientWindowPtr = NULL; - lastClientStage = SelectionStageNone; - - if (pszReturnData != NULL) - { - XFree(pszReturnData); - } - - return; - } switch (lastClientStage) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c index fe0e567f6..75758679f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c @@ -291,20 +291,9 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen) pCmap = (ColormapPtr)LookupIDByType(pScreen->defColormap, RT_COLORMAP); - if (pCmap != NULL) - { - XSetWindowColormap(nxagentDisplay, - nxagentDefaultWindows[pScreen->myNum], - nxagentColormap(pCmap)); - } - #ifdef WARNING - else - { - fprintf(stderr, "nxagentSetInstalledColormapWindows: WARNING! " - "Window at [%p] has no colormap with class [%d].\n", - pWin, pWin -> drawable.class); - } - #endif + XSetWindowColormap(nxagentDisplay, + nxagentDefaultWindows[pScreen->myNum], + nxagentColormap(pCmap)); } #endif /* DUMB_WINDOW_MANAGERS */ } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Dialog.h b/nx-X11/programs/Xserver/hw/nxagent/Dialog.h index a28329457..135cd2df3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Dialog.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Dialog.h @@ -42,7 +42,7 @@ extern int nxagentKillDialogPid; extern int nxagentSuspendDialogPid; extern int nxagentRootlessDialogPid; extern int nxagentPulldownDialogPid; -extern int nxagentFontsReplacementDialogPid; +extern int nxagentFontsReplacement; extern int nxagentEnableRandRModeDialogPid; extern int nxagentDisableRandRModeDialogPid; extern int nxagentEnableDeferModePid; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 8d72654e6..9f257e508 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -453,21 +453,6 @@ static void nxagentSigchldHandler(int signal) } } - if (pid == 0 && nxagentFontsReplacementDialogPid) - { - pid = waitpid(nxagentFontsReplacementDialogPid, &status, options); - - if (pid == -1 && errno == ECHILD) - { - #ifdef WARNING - fprintf(stderr, "nxagentSigchldHandler: Got ECHILD waiting for child %d (Fonts replacement).\n", - nxagentFontsReplacementDialogPid); - #endif - - pid = nxagentFontsReplacementDialogPid = 0; - } - } - if (pid == 0 && nxagentEnableRandRModeDialogPid) { pid = waitpid(nxagentEnableRandRModeDialogPid, &status, options); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index 82723b5a0..2c1b07fa5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -32,7 +32,6 @@ #include "Handlers.h" #include "Pixels.h" #include "Reconnect.h" -#include "GCOps.h" #include "NXlib.h" @@ -419,14 +418,13 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned if (useStoredBitmap != 0) { #ifdef TEST - fprintf(stderr, "nxagentSynchronizeRegion: Drawable [%s] at [%p] has a synchronization bitmap at [%p] " + fprintf(stderr, "nxagentSynchronizeRegion: Drawable [%s] at [%p] has a synchronization bitmap " "[%d,%d,%d,%d] with [%ld] rects.\n", nxagentDrawableType(pDrawable), - (void *) pDrawable, (void *) nxagentDrawableBitmap(pDrawable), - nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.x1, - nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.y1, - nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.x2, - nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.y2, - REGION_NUM_RECTS(nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)))); + (void *) pDrawable, nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.x1, + nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.y1, + nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.x2, + nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.y2, + REGION_NUM_RECTS(nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)))); #endif clipRegion = nxagentCreateRegion(pDrawable, NULL, 0, 0, pDrawable -> width, pDrawable -> height); @@ -583,7 +581,8 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: Going to synchronize [%ld] rects of [%s] at [%p].\n", - REGION_NUM_RECTS(clipRegion), nxagentDrawableType(pDrawable), (void *) pDrawable); + REGION_NUM_RECTS(clipRegion), (pDrawable -> type == DRAWABLE_PIXMAP ? "Pixmap" : "Window"), + (void *) pDrawable); fprintf(stderr, "nxagentSynchronizeRegion: Extents geometry [%d,%d,%d,%d].\n", clipRegion -> extents.x1, clipRegion -> extents.y1, clipRegion -> extents.x2, clipRegion -> extents.y2); @@ -616,22 +615,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned if (data == NULL) { #ifdef WARNING - fprintf(stderr, "nxagentSynchronizeRegion: WARNING! Failed to allocate memory for synchronization.\n"); - - /* - * Print detailed informations if the - * image length is zero. - */ - - if (length == 0) - { - fprintf(stderr, "nxagentSynchronizeRegion: Drawable [%s] at [%p] with region geometry [%ld][%d,%d,%d,%d].\n", - nxagentDrawableType(pDrawable), (void *) pDrawable, REGION_NUM_RECTS(clipRegion), - clipRegion -> extents.x1, clipRegion -> extents.y1, - clipRegion -> extents.x2, clipRegion -> extents.y2); - } - #endif goto nxagentSynchronizeRegionFree; @@ -686,14 +670,10 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned if (nxagentDrawableStatus(pDrawable) == Synchronized) { #ifdef WARNING - if (pDrawable -> type == DRAWABLE_WINDOW && pSrcDrawable != pDrawable) - { fprintf(stderr, "nxagentSynchronizeRegion: WARNING! Trying to synchronize " "the clean drawable type [%d] at [%p] with source at [%p].\n", pDrawable -> type, (void *) pDrawable, (void *) pSrcDrawable); - } - #endif goto nxagentSynchronizeRegionStop; @@ -768,6 +748,9 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned nxagentGetImage(pSrcDrawable, x, y, w, h, format, AllPlanes, data); + nxagentRealizeImage(pDrawable, pGC, pDrawable -> depth, + x, y, w, h, leftPad, format, data); + /* * Going to unmark the synchronized * region. @@ -822,13 +805,6 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned nxagentUnmarkCorruptedRegion(pDrawable, &tileRegion); } - #ifdef TEST - else - { - fprintf(stderr, "nxagentSynchronizeRegion: Tile [%d,%d,%d,%d] on drawable [%p] doesn't match.\n", - x, y, x + w, y + h, (void *) pDrawable); - } - #endif } else { @@ -859,14 +835,6 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned } } - /* - * Realize the image after comparing the - * source data with the bitmap data. - */ - - nxagentRealizeImage(pDrawable, pGC, pDrawable -> depth, - x, y, w, h, leftPad, format, data); - REGION_UNINIT(pDrawable -> pScreen, &tileRegion); #if !defined(COLLECTED_UPDATES) @@ -2587,13 +2555,16 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable) GCPtr pGC = NULL; RegionPtr pClipRegion = NullRegion; + char *data = NULL; + int x, y; int w, h; + int length, format; int saveTrap; #ifdef TEST - fprintf(stderr, "nxagentCreateDrawableBitmap: Creating synchronization bitmap for [%s] at [%p].\n", - nxagentDrawableType(pDrawable), (void *) pDrawable); + fprintf(stderr, "nxagentCreateDrawableBitmap: Creating synchronization bitmap for drawable at [%p].\n", + (void *) pDrawable); #endif /* @@ -2681,8 +2652,24 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable) w = pClipRegion -> extents.x2 - pClipRegion -> extents.x1; h = pClipRegion -> extents.y2 - pClipRegion -> extents.y1; - nxagentCopyArea(pDrawable, (DrawablePtr) pBitmap, pGC, x, y, w, h, x, y); + data = nxagentAllocateImageData(w, h, pDrawable -> depth, &length, &format); + + if (data == NULL) + { + #ifdef WARNING + fprintf(stderr, "nxagentCreateDrawableBitmap: Cannot allocate memory for the bitmap data.\n"); + #endif + + nxagentDestroyPixmap(pBitmap); + goto nxagentCreateDrawableBitmapEnd; + } + + nxagentGetImage(pDrawable, x, y, w, h, format, AllPlanes, data); + + nxagentPutImage((DrawablePtr) pBitmap, pGC, pBitmap -> drawable.depth, x, y, w, h, + 0, format, data); + REGION_UNION(pDrawable -> pScreen, nxagentCorruptedRegion((DrawablePtr) pBitmap), nxagentCorruptedRegion((DrawablePtr) pBitmap), pClipRegion); @@ -2724,6 +2711,11 @@ nxagentCreateDrawableBitmapEnd: nxagentFreeRegion(pDrawable, pClipRegion); } + if (data != NULL) + { + xfree(data); + } + if (pGC != NULL) { FreeScratchGC(pGC); @@ -3099,16 +3091,6 @@ void nxagentSendBackgroundExpose(WindowPtr pWin, PixmapPtr pBackground, RegionPt REGION_INTERSECT(pWin -> pScreen, &expose, &expose, &pWin -> clipList); - /* - * Reduce the overall region to expose. - */ - - REGION_TRANSLATE(pWin -> pScreen, &expose, -pWin -> drawable.x, -pWin -> drawable.y); - - REGION_SUBTRACT(pWin -> pScreen, pExpose, pExpose, &expose); - - REGION_TRANSLATE(pWin -> pScreen, &expose, pWin -> drawable.x, pWin -> drawable.y); - miWindowExposures(pWin, &expose, &expose); nxagentSendBackgroundExposeEnd: diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index e456989cd..ab8c13cae 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -63,13 +63,7 @@ #include "NXproto.h" #include "xfixesproto.h" -#define Window XlibWindow -#define Atom XlibAtom -#define Time XlibXID #include <X11/extensions/Xfixes.h> -#undef Window -#undef Atom -#undef Time #ifdef NXAGENT_FIXKEYS #include "inputstr.h" @@ -795,19 +789,13 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) } x.u.u.type = KeyRelease; - x.u.u.detail = nxagentConvertKeycode(X.xkey.keycode); - x.u.keyButtonPointer.time = nxagentLastKeyPressTime + - (X.xkey.time - nxagentLastServerTime); + x.u.u.detail = X.xkey.keycode; + x.u.keyButtonPointer.time = nxagentLastKeyPressTime + (X.xkey.time - nxagentLastServerTime); nxagentLastServerTime = X.xkey.time; nxagentLastEventTime = GetTimeInMillis(); - if (x.u.keyButtonPointer.time > nxagentLastEventTime) - { - x.u.keyButtonPointer.time = nxagentLastEventTime; - } - if (!(nxagentCheckSpecialKeystroke(&X.xkey, &result))) { mieqEnqueue(&x); @@ -930,7 +918,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) #ifdef NX_DEBUG_INPUT if (nxagentDebugInput == 1) { - fprintf(stderr, "nxagentDispatchEvents: Going to handle new ButtonRelease event.\n"); + fprintf(stderr, "nxagentDispatchEvents: Going to handle new ButtonPress event.\n"); } #endif @@ -1028,17 +1016,18 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) nxagentLastEnteredWindow = pWin; } - if (nxagentPulldownDialogPid == 0 && nxagentLastEnteredTopLevelWindow && - (X.xmotion.y_root < nxagentLastEnteredTopLevelWindow -> drawable.y + 4)) + if (nxagentPulldownDialogPid == 0 && (X.xmotion.y_root < + nxagentLastEnteredTopLevelWindow -> drawable.y + 4)) { - if (pWin && nxagentClientIsDialog(wClient(pWin)) == 0 && - nxagentLastEnteredTopLevelWindow -> parent == WindowTable[0] && - nxagentLastEnteredTopLevelWindow -> overrideRedirect == False && - X.xmotion.x_root > (nxagentLastEnteredTopLevelWindow -> drawable.x + - (nxagentLastEnteredTopLevelWindow -> drawable.width >> 1) - 50) && - X.xmotion.x_root < (nxagentLastEnteredTopLevelWindow -> drawable.x + - (nxagentLastEnteredTopLevelWindow -> drawable.width >> 1) + 50) && - nxagentOption(Menu) == 1) + if (pWin && nxagentLastEnteredTopLevelWindow && + nxagentClientIsDialog(wClient(pWin)) == 0 && + nxagentLastEnteredTopLevelWindow -> parent == WindowTable[0] && + nxagentLastEnteredTopLevelWindow -> overrideRedirect == False && + X.xmotion.x_root > (nxagentLastEnteredTopLevelWindow -> drawable.x + + (nxagentLastEnteredTopLevelWindow -> drawable.width >> 1) - 50) && + X.xmotion.x_root < (nxagentLastEnteredTopLevelWindow -> drawable.x + + (nxagentLastEnteredTopLevelWindow -> drawable.width >> 1) + 50) && + nxagentOption(Menu) == 1) { nxagentPulldownDialog(nxagentLastEnteredTopLevelWindow -> drawable.id); } @@ -1063,8 +1052,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) #ifdef NX_DEBUG_INPUT if (nxagentDebugInput == 1) { - fprintf(stderr, "nxagentDispatchEvents: Adding motion event [%d, %d] to the queue.\n", - x.u.keyButtonPointer.rootX, x.u.keyButtonPointer.rootY); + fprintf(stderr, "nxagentDispatchEvents: Adding motion event [%d, %d] to the queue.\n", x.u.keyButtonPointer.rootX, x.u.keyButtonPointer.rootY); } #endif @@ -1923,9 +1911,8 @@ int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result) nxagentLastEventTime = nxagentLastKeyPressTime = GetTimeInMillis(); - x.u.u.type = KeyPress; - x.u.u.detail = nxagentConvertKeycode(X -> xkey.keycode); + x.u.u.detail = X -> xkey.keycode; x.u.keyButtonPointer.time = nxagentLastKeyPressTime; nxagentLastServerTime = X -> xkey.time; @@ -4027,180 +4014,4 @@ void nxagentGuessDumpInputInfo(ClientPtr client, Atom property, char *data) } } -void nxagentDeactivateInputDevicesGrabs() -{ - fprintf(stderr, "Info: Deactivating input devices grabs.\n"); - - if (inputInfo.pointer -> grab) - { - (*inputInfo.pointer -> DeactivateGrab)(inputInfo.pointer); - } - - if (inputInfo.keyboard -> grab) - { - (*inputInfo.keyboard -> DeactivateGrab)(inputInfo.keyboard); - } -} - -static const char *nxagentGrabStateToString(int state) -{ - switch (state) - { - case 0: - return "NOT_GRABBED"; - case 1: - return "THAWED"; - case 2: - return "THAWED_BOTH"; - case 3: - return "FREEZE_NEXT_EVENT"; - case 4: - return "FREEZE_BOTH_NEXT_EVENT"; - case 5: - return "FROZEN_NO_EVENT"; - case 6: - return "FROZEN_WITH_EVENT"; - case 7: - return "THAW_OTHERS"; - default: - return "unknown state"; - } -} - -void nxagentDumpInputDevicesState(void) -{ - int i, k; - int mask = 1; - CARD8 val; - DeviceIntPtr dev; - GrabPtr grab; - WindowPtr pWin = NULL; - - fprintf(stderr, "\n*** Dump input devices state: BEGIN ***" - "\nKeys down:"); - - dev = inputInfo.keyboard; - - for (i = 0; i < DOWN_LENGTH; i++) - { - val = dev -> key -> down[i]; - - if (val != 0) - { - for (k = 0; k < 8; k++) - { - if (val & (mask << k)) - { - fprintf(stderr, "\n\t[%d] [%s]", i * 8 + k, - XKeysymToString(XKeycodeToKeysym(nxagentDisplay, i * 8 + k, 0))); - } - } - } - } - - fprintf(stderr, "\nKeyboard device state: \n\tdevice [%p]\n\tlast grab time [%lu]" - "\n\tfrozen [%s]\n\tstate [%s]\n\tother [%p]\n\tevent count [%d]" - "\n\tfrom passive grab [%s]\n\tactivating key [%d]", dev, - dev -> grabTime.milliseconds, dev -> sync.frozen ? "Yes": "No", - nxagentGrabStateToString(dev -> sync.state), - dev -> sync.other, dev -> sync.evcount, - dev -> fromPassiveGrab ? "Yes" : "No", - dev -> activatingKey); - - grab = dev -> grab; - - if (grab) - { - fprintf(stderr, "\nKeyboard grab state: \n\twindow pointer [%p]" - "\n\towner events flag [%s]\n\tgrab mode [%s]", - grab -> window, grab -> ownerEvents ? "True" : "False", - grab -> keyboardMode ? "asynchronous" : "synchronous"); - - /* - * Passive grabs. - */ - - pWin = grab -> window; - grab = wPassiveGrabs(pWin); - - while (grab) - { - fprintf(stderr, "\nPassive grab state: \n\tdevice [%p]\n\towner events flag [%s]" - "\n\tpointer grab mode [%s]\n\tkeyboard grab mode [%s]\n\tevent type [%d]" - "\n\tmodifiers [%x]\n\tbutton/key [%u]\n\tevent mask [%lx]", - grab -> device, grab -> ownerEvents ? "True" : "False", - grab -> pointerMode ? "asynchronous" : "synchronous", - grab -> keyboardMode ? "asynchronous" : "synchronous", - grab -> type, grab -> modifiersDetail.exact, - grab -> detail.exact, grab -> eventMask); - - grab = grab -> next; - } - } - - fprintf(stderr, "\nButtons down:"); - - dev = inputInfo.pointer; - - for (i = 0; i < DOWN_LENGTH; i++) - { - val = dev -> button -> down[i]; - - if (val != 0) - { - for (k = 0; k < 8; k++) - { - if (val & (mask << k)) - { - fprintf(stderr, "\n\t[%d]", i * 8 + k); - } - } - } - } - - fprintf(stderr, "\nPointer device state: \n\tdevice [%p]\n\tlast grab time [%lu]" - "\n\tfrozen [%s]\n\tstate [%s]\n\tother [%p]\n\tevent count [%d]" - "\n\tfrom passive grab [%s]\n\tactivating button [%d]", dev, - dev -> grabTime.milliseconds, dev -> sync.frozen ? "Yes" : "No", - nxagentGrabStateToString(dev -> sync.state), - dev -> sync.other, dev -> sync.evcount, - dev -> fromPassiveGrab ? "Yes" : "No", - dev -> activatingKey); - - grab = dev -> grab; - - if (grab) - { - fprintf(stderr, "\nPointer grab state: \n\twindow pointer [%p]" - "\n\towner events flag [%s]\n\tgrab mode [%s]", - grab -> window, grab -> ownerEvents ? "True" : "False", - grab -> pointerMode ? "asynchronous" : "synchronous"); - - if (grab -> window != pWin) - { - /* - * Passive grabs. - */ - - grab = wPassiveGrabs(grab -> window); - - while (grab) - { - fprintf(stderr, "\nPassive grab state: \n\tdevice [%p]\n\towner events flag [%s]" - "\n\tpointer grab mode [%s]\n\tkeyboard grab mode [%s]\n\tevent type [%d]" - "\n\tmodifiers [%x]\n\tbutton/key [%u]\n\tevent mask [%lx]", - grab -> device, grab -> ownerEvents ? "True" : "False", - grab -> pointerMode ? "asynchronous" : "synchronous", - grab -> keyboardMode ? "asynchronous" : "synchronous", - grab -> type, grab -> modifiersDetail.exact, - grab -> detail.exact, grab -> eventMask); - - grab = grab -> next; - } - } - } - - fprintf(stderr, "\n*** Dump input devices state: FINISH ***\n"); -} - #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c index 87f9f0201..3f1fd0b43 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c @@ -65,34 +65,26 @@ is" without express or implied warranty. #define NXAGENT_ALTERNATE_FONT_DIR "/usr/share/X11/fonts" #define NXAGENT_ALTERNATE_FONT_DIR_2 "/usr/share/fonts/X11" #define NXAGENT_ALTERNATE_FONT_DIR_3 "/usr/share/fonts" -#define NXAGENT_ALTERNATE_FONT_DIR_4 "/usr/NX/share/fonts" #define NXAGENT_DEFAULT_FONT_PATH \ "/usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/X11/fonts/Speedo/,\ /usr/X11R6/lib/X11/fonts/Type1/,/usr/X11R6/lib/X11/fonts/75dpi/,\ -/usr/X11R6/lib/X11/fonts/100dpi/,/usr/X11R6/lib/X11/fonts/TTF/,\ -/usr/NX/share/fonts/base" +/usr/X11R6/lib/X11/fonts/100dpi/,/usr/X11R6/lib/X11/fonts/TTF/" #define NXAGENT_ALTERNATE_FONT_PATH \ "/usr/share/X11/fonts/misc/,/usr/share/X11/fonts/Speedo/,\ /usr/share/X11/fonts/Type1/,/usr/share/X11/fonts/75dpi/,\ -/usr/share/X11/fonts/100dpi/,/usr/share/X11/fonts/TTF/,\ -/usr/NX/share/fonts/base" +/usr/share/X11/fonts/100dpi/,/usr/share/X11/fonts/TTF/" #define NXAGENT_ALTERNATE_FONT_PATH_2 \ "/usr/share/fonts/X11/misc/,/usr/share/fonts/X11/Speedo/,\ /usr/share/fonts/X11/Type1/,/usr/share/fonts/X11/75dpi/,\ -/usr/share/fonts/X11/100dpi/,/usr/share/fonts/X11/TTF/,\ -/usr/NX/share/fonts/base" +/usr/share/fonts/X11/100dpi/,/usr/share/fonts/X11/TTF/" #define NXAGENT_ALTERNATE_FONT_PATH_3 \ "/usr/share/fonts/misc/,/usr/share/fonts/Speedo/,\ /usr/share/fonts/Type1/,/usr/share/fonts/75dpi/,\ -/usr/share/fonts/100dpi/,/usr/share/fonts/TTF/,\ -/usr/NX/share/fonts/base" - -#define NXAGENT_ALTERNATE_FONT_PATH_4 \ -"/usr/NX/share/fonts/base" +/usr/share/fonts/100dpi/,/usr/share/fonts/TTF/" #undef NXAGENT_FONTCACHE_DEBUG #undef NXAGENT_RECONNECT_FONT_DEBUG @@ -1561,31 +1553,6 @@ void nxagentVerifyDefaultFontPath(void) strcat(fontPath, NXAGENT_ALTERNATE_FONT_PATH_3); } - if (stat(NXAGENT_ALTERNATE_FONT_DIR_4, &dirStat) == 0 && - S_ISDIR(dirStat.st_mode) != 0) - { - /* - * Let's use the "/usr/NX/share/fonts" path. - */ - - #ifdef TEST - fprintf(stderr, "nxagentVerifyDefaultFontPath: Assuming fonts in directory [%s].\n", - validateString(NXAGENT_ALTERNATE_FONT_DIR_4)); - #endif - - if (*fontPath != '\0') - { - fontPath = realloc(fontPath, strlen(fontPath) + strlen(NXAGENT_ALTERNATE_FONT_PATH_4) + 2); - strcat(fontPath, ","); - } - else - { - fontPath = realloc(fontPath, strlen(fontPath) + strlen(NXAGENT_ALTERNATE_FONT_PATH_4) + 1); - } - - strcat(fontPath, NXAGENT_ALTERNATE_FONT_PATH_4); - } - if (*fontPath == '\0') { #ifdef WARNING diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index 9afd6e392..83aa04f11 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -594,8 +594,6 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, unsigned int format; unsigned long planeMask = 0xffffffff; - int oldDstxyValue; - RegionPtr pDstRegion; int skip = 0; @@ -607,91 +605,6 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, (void *) pDstDrawable, srcx, srcy, dstx, dsty, width, height); #endif - /* - * Here, before using fbDoCopy() called by fbCopyArea(), - * it should be provided that the cast in fbDoCopy() from - * int to short int would not cut off significative bits. - */ - - if (dstx + pDstDrawable->x + width > 32767) - { - #ifdef WARNING - fprintf(stderr, "nxagentCopyArea: x2 exceeding short int.\n"); - #endif - - width = 32767 - dstx - pDstDrawable->x; - - if (width <= 0) - { - #ifdef TEST - fprintf(stderr, "nxagentCopyArea: Returning null on x2 check.\n"); - #endif - - return NullRegion; - } - } - - if (dstx + pDstDrawable->x < -32768) - { - #ifdef WARNING - fprintf(stderr, "nxagentCopyArea: x1 exceeding short int.\n"); - #endif - - width += pDstDrawable->x + dstx + 32768; - srcx -= pDstDrawable->x + dstx + 32768; - dstx = -32768 - pDstDrawable->x; - - if (width <= 0) - { - #ifdef TEST - fprintf(stderr, "nxagentCopyArea: Returning null on x1 check.\n"); - #endif - - return NullRegion; - } - } - - oldDstxyValue = dsty; - - if (dsty + pDstDrawable->y + height > 32767) - { - #ifdef WARNING - fprintf(stderr, "nxagentCopyArea: y2 exceeding short int.\n"); - #endif - - height = 32767 - dsty - pDstDrawable->y; - - if (height <= 0) - { - #ifdef TEST - fprintf(stderr, "nxagentCopyArea: Returning null on y2 check.\n"); - #endif - - return NullRegion; - } - } - - if (dsty + pDstDrawable->y < -32768) - { - #ifdef WARNING - fprintf(stderr, "nxagentCopyArea: y1 exceeding short int.\n"); - #endif - - height += 32768 + pDstDrawable->y + dsty; - srcy -= 32768 + pDstDrawable->y + dsty; - dsty = -32768 - pDstDrawable->y; - - if (height <= 0) - { - #ifdef TEST - fprintf(stderr, "nxagentCopyArea: Returning null on y1 check.\n"); - #endif - - return NullRegion; - } - } - - if (nxagentGCTrap == 1 || nxagentShmTrap == 1) { if (pSrcDrawable -> type == DRAWABLE_PIXMAP && diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index 3d94e63af..3abc3575f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -105,13 +105,6 @@ #define MINIMUM_DISPLAY_BUFFER 512 -#ifdef NX_DEBUG_INPUT -extern int nxagentDebugInputDevices; -extern unsigned long nxagentLastInputDevicesDumpTime; - -extern void nxagentDumpInputDevicesState(void); -#endif - /* * Used in the handling of the X desktop * manager protocol. @@ -193,18 +186,6 @@ void nxagentBlockHandler(pointer data, struct timeval **timeout, pointer mask) now = GetTimeInMillis(); - #ifdef NX_DEBUG_INPUT - - if (nxagentDebugInputDevices == 1 && - now - nxagentLastInputDevicesDumpTime > 5000) - { - nxagentLastInputDevicesDumpTime = now; - - nxagentDumpInputDevicesState(); - } - - #endif - if (nxagentNeedConnectionChange() == 1) { #ifdef TEST @@ -559,8 +540,6 @@ void nxagentBlockHandler(pointer data, struct timeval **timeout, pointer mask) #endif - nxagentPrintGeometry(); - #ifdef BLOCKS fprintf(stderr, "[End block]\n"); #endif @@ -841,8 +820,6 @@ FIXME: Must queue multiple writes and handle #endif - nxagentPrintGeometry(); - #ifdef BLOCKS fprintf(stderr, "[End block]\n"); #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 6c14e20bf..37e49eaeb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -75,8 +75,6 @@ is" without express or implied warranty. static int nxagentXkbGetNames(char **rules, char **model, char **layout, char **variant, char **options); -static void nxagentKeycodeConversionSetup(void); - #endif /* XKB */ /* @@ -191,281 +189,6 @@ unsigned int nxagentAltMetaMask; void nxagentCheckAltMetaKeys(CARD8, int); -static CARD8 nxagentConvertedKeycodes[] = -{ - /* evdev pc105*/ - /* 0 */ 0, - /* 1 */ 1, - /* 2 */ 2, - /* 3 */ 3, - /* 4 */ 4, - /* 5 */ 5, - /* 6 */ 6, - /* 7 */ 7, - /* 8 */ 8, - /* 9 */ 9, - /* 10 */ 10, - /* 11 */ 11, - /* 12 */ 12, - /* 13 */ 13, - /* 14 */ 14, - /* 15 */ 15, - /* 16 */ 16, - /* 17 */ 17, - /* 18 */ 18, - /* 19 */ 19, - /* 20 */ 20, - /* 21 */ 21, - /* 22 */ 22, - /* 23 */ 23, - /* 24 */ 24, - /* 25 */ 25, - /* 26 */ 26, - /* 27 */ 27, - /* 28 */ 28, - /* 29 */ 29, - /* 30 */ 30, - /* 31 */ 31, - /* 32 */ 32, - /* 33 */ 33, - /* 34 */ 34, - /* 35 */ 35, - /* 36 */ 36, - /* 37 */ 37, - /* 38 */ 38, - /* 39 */ 39, - /* 40 */ 40, - /* 41 */ 41, - /* 42 */ 42, - /* 43 */ 43, - /* 44 */ 44, - /* 45 */ 45, - /* 46 */ 46, - /* 47 */ 47, - /* 48 */ 48, - /* 49 */ 49, - /* 50 */ 50, - /* 51 */ 51, - /* 52 */ 52, - /* 53 */ 53, - /* 54 */ 54, - /* 55 */ 55, - /* 56 */ 56, - /* 57 */ 57, - /* 58 */ 58, - /* 59 */ 59, - /* 60 */ 60, - /* 61 */ 61, - /* 62 */ 62, - /* 63 */ 63, - /* 64 */ 64, - /* 65 */ 65, - /* 66 */ 66, - /* 67 */ 67, - /* 68 */ 68, - /* 69 */ 69, - /* 70 */ 70, - /* 71 */ 71, - /* 72 */ 72, - /* 73 */ 73, - /* 74 */ 74, - /* 75 */ 75, - /* 76 */ 76, - /* 77 */ 77, - /* 78 */ 78, - /* 79 */ 79, - /* 80 */ 80, - /* 81 */ 81, - /* 82 */ 82, - /* 83 */ 83, - /* 84 */ 84, - /* 85 */ 85, - /* 86 */ 86, - /* 87 */ 87, - /* 88 */ 88, - /* 89 */ 89, - /* 90 */ 90, - /* 91 */ 91, - /* 92 */ 124, - /* 93 */ 93, - /* 94 */ 94, - /* 95 */ 95, - /* 96 */ 96, - /* 97 */ 211, - /* 98 */ 98, - /* 99 */ 99, - /* 100 */ 100, - /* 101 */ 208, - /* 102 */ 102, - /* 103 */ 103, - /* 104 */ 108, - /* 105 */ 109, - /* 106 */ 112, - /* 107 */ 111, - /* 108 */ 113, - /* 109 */ 109, - /* 110 */ 97, - /* 111 */ 98, - /* 112 */ 99, - /* 113 */ 100, - /* 114 */ 102, - /* 115 */ 103, - /* 116 */ 104, - /* 117 */ 105, - /* 118 */ 106, - /* 119 */ 107, - /* 120 */ 120, - /* 121 */ 121, - /* 122 */ 122, - /* 123 */ 123, - /* 124 */ 124, - /* 125 */ 126, - /* 126 */ 126, - /* 127 */ 110, - /* 128 */ 128, - /* 129 */ 129, - /* 130 */ 130, - /* 131 */ 131, - /* 132 */ 133, - /* 133 */ 115, - /* 134 */ 116, - /* 135 */ 117, - /* 136 */ 136, - /* 137 */ 137, - /* 138 */ 138, - /* 139 */ 139, - /* 140 */ 140, - /* 141 */ 141, - /* 142 */ 142, - /* 143 */ 143, - /* 144 */ 144, - /* 145 */ 145, - /* 146 */ 146, - /* 147 */ 147, - /* 148 */ 148, - /* 149 */ 149, - /* 150 */ 150, - /* 151 */ 151, - /* 152 */ 152, - /* 153 */ 153, - /* 154 */ 154, - /* 155 */ 155, - /* 156 */ 156, - /* 157 */ 157, - /* 158 */ 158, - /* 159 */ 159, - /* 160 */ 160, - /* 161 */ 161, - /* 162 */ 162, - /* 163 */ 163, - /* 164 */ 164, - /* 165 */ 165, - /* 166 */ 166, - /* 167 */ 167, - /* 168 */ 168, - /* 169 */ 169, - /* 170 */ 170, - /* 171 */ 171, - /* 172 */ 172, - /* 173 */ 173, - /* 174 */ 174, - /* 175 */ 175, - /* 176 */ 176, - /* 177 */ 177, - /* 178 */ 178, - /* 179 */ 179, - /* 180 */ 180, - /* 181 */ 181, - /* 182 */ 182, - /* 183 */ 183, - /* 184 */ 184, - /* 185 */ 185, - /* 186 */ 186, - /* 187 */ 187, - /* 188 */ 188, - /* 189 */ 189, - /* 190 */ 190, - /* 191 */ 118, - /* 192 */ 119, - /* 193 */ 120, - /* 194 */ 121, - /* 195 */ 122, - /* 196 */ 196, - /* 197 */ 197, - /* 198 */ 198, - /* 199 */ 199, - /* 200 */ 200, - /* 201 */ 201, - /* 202 */ 202, - /* 203 */ 93, - /* 204 */ 125, - /* 205 */ 156, - /* 206 */ 127, - /* 207 */ 128, - /* 208 */ 208, - /* 209 */ 209, - /* 210 */ 210, - /* 211 */ 211, - /* 212 */ 212, - /* 213 */ 213, - /* 214 */ 214, - /* 215 */ 215, - /* 216 */ 216, - /* 217 */ 217, - /* 218 */ 218, - /* 219 */ 219, - /* 220 */ 220, - /* 221 */ 221, - /* 222 */ 222, - /* 223 */ 223, - /* 224 */ 224, - /* 225 */ 225, - /* 226 */ 226, - /* 227 */ 227, - /* 228 */ 228, - /* 229 */ 229, - /* 230 */ 230, - /* 231 */ 231, - /* 232 */ 232, - /* 233 */ 233, - /* 234 */ 234, - /* 235 */ 235, - /* 236 */ 236, - /* 237 */ 237, - /* 238 */ 238, - /* 239 */ 239, - /* 240 */ 240, - /* 241 */ 241, - /* 242 */ 242, - /* 243 */ 243, - /* 244 */ 244, - /* 245 */ 245, - /* 246 */ 246, - /* 247 */ 247, - /* 248 */ 248, - /* 249 */ 249, - /* 250 */ 250, - /* 251 */ 251, - /* 252 */ 252, - /* 253 */ 253, - /* 254 */ 254, - /* 255 */ 255 -}; - -static int nxagentKeycodeConversion = 0; - -CARD8 nxagentConvertKeycode(CARD8 k) -{ - if (nxagentKeycodeConversion != 0) - { - return nxagentConvertedKeycodes[k]; - } - else - { - return k; - } -} - static int nxagentSaveKeyboardDeviceData(DeviceIntPtr dev, DeviceIntPtr devBackup); static int nxagentRestoreKeyboardDeviceData(DeviceIntPtr devBackup, DeviceIntPtr dev); @@ -675,6 +398,13 @@ int nxagentKeyboardProc(DeviceIntPtr pDev, int onoff) int ret; + char *remoteRules = NULL; + char *remoteModel = NULL; + + unsigned int remoteRulesLen; + + XkbRF_VarDefsRec remoteDefs; + switch (onoff) { case DEVICE_INIT: @@ -946,21 +676,14 @@ XkbError: xkb = XkbGetKeyboard(nxagentDisplay, XkbGBN_AllComponentsMask, XkbUseCoreKbd); - nxagentKeycodeConversionSetup(); - if (xkb == NULL || xkb->geom == NULL) { #ifdef TEST fprintf(stderr, "nxagentKeyboardProc: No current keyboard.\n"); - if (xkb == NULL) - { - fprintf(stderr, "nxagentKeyboardProc: xkb is null.\n"); - } - else - { - fprintf(stderr, "nxagentKeyboardProc: xkb->geom is null.\n"); - } - fprintf(stderr, "nxagentKeyboardProc: Going to set rules and init device.\n"); + #endif + + #ifdef TEST + fprintf(stderr, "nxagentKeyboardProc: No keyboard, going to set rules and init device.\n"); #endif XkbSetRulesDflts(rules, model, layout, variants, options); @@ -976,6 +699,40 @@ XkbError: goto XkbEnd; } + if (xkb != NULL) + { + char *drules = 0; + char *dmodel = 0; + char *dlayout = 0; + char *dvariant = 0; + char *doptions = 0; + + remoteRulesLen = nxagentXkbGetNames(&drules, &dmodel, &dlayout, + &dvariant, &doptions); + + if (remoteRulesLen != 0 && drules != NULL && dmodel != NULL) + { + #ifdef DEBUG + fprintf(stderr, "nxagentKeyboardProc: Remote: [%s,%s,%s,%s,%s].\n", + drules, dmodel, dlayout, dvariant, doptions); + #endif + + remoteRules = drules; + remoteModel = dmodel; + remoteDefs.model = dmodel; + remoteDefs.layout = dlayout; + remoteDefs.variant = dvariant; + remoteDefs.options = doptions; + } + #ifdef DEBUG + else + { + fprintf(stderr, "nxagentKeyboardProc: Failed to retrieve remote " + "rules"); + } + #endif + } + XkbGetControls(nxagentDisplay, XkbAllControlsMask, xkb); nxagentXkbConfigFilePathSize = strlen(XkbBaseDirectory) + @@ -1056,6 +813,66 @@ XkbError: free(nxagentXkbConfigFilePath); + if (xkb != NULL && nxagentOption(ClientOs) == ClientOsLinux && + remoteRules != NULL && remoteModel != NULL && + (strcmp(remoteRules, "evdev") == 0 || + strcmp(remoteModel, "evdev") == 0) && + pDev->key->xkbInfo != NULL && + pDev->key->xkbInfo->desc != NULL) + { + XkbDescPtr xkbt; + void *tmp; + #ifdef _XSERVER64 + int i; + #endif + + xkbt = pDev->key->xkbInfo->desc; + + xkbt->min_key_code = xkb->min_key_code; + xkbt->max_key_code = xkb->max_key_code; + + if (xkbt->map != NULL && xkb->map != NULL) + { + tmp = (void *)xkbt->map; + xkbt->map = xkb->map; + xkb->map = (XkbClientMapPtr)tmp; + + #ifdef _XSERVER64 + + tmp = (void *) xkbt->map->syms; + xkbt->map->syms = xalloc(xkbt->map->size_syms * sizeof(KeySym)); + + for (i = 0; i < xkbt->map->size_syms; i++) + { + xkbt->map->syms[i] = ((KeySym64 *)tmp)[i]; + } + + #endif + } + + if (xkbt->server != NULL && xkb->server != NULL) + { + tmp = (void *)xkbt->server; + xkbt->server = xkb->server; + xkb->server = (XkbServerMapPtr)tmp; + } + + if (xkbt->compat != NULL && xkb->compat != NULL) + { + tmp = (void *)xkbt->compat; + xkbt->compat = xkb->compat; + xkb->compat = (XkbCompatMapPtr)tmp; + } + + XkbSetRulesDflts(remoteRules, remoteDefs.model, remoteDefs.layout, + remoteDefs.variant, remoteDefs.options); + XkbSetRulesUsed(&remoteDefs); + + free(remoteRules); + + goto XkbEnd; + } + if (!nxagentKeyboard || (nxagentKeyboard && (strcmp(nxagentKeyboard, "query") == 0))) { @@ -1745,70 +1562,4 @@ static int nxagentXkbGetNames(char **rules, char **model, char **layout, return n; } -void nxagentKeycodeConversionSetup(void) -{ - char *drules = 0; - char *dmodel = 0; - char *dlayout = 0; - char *dvariant = 0; - char *doptions = 0; - unsigned int drulesLen; - - nxagentKeycodeConversion = 0; - - drulesLen = nxagentXkbGetNames(&drules, &dmodel, &dlayout, - &dvariant, &doptions); - - #ifdef DEBUG - if (drulesLen != 0 && drules != NULL && dmodel != NULL) - { - fprintf(stderr, "nxagentKeycodeConversionSetup: " - "Remote: [%s,%s,%s,%s,%s].\n", drules, dmodel, dlayout, - dvariant, doptions); - } - else - { - fprintf(stderr, "nxagentKeycodeConversionSetup: " - "Failed to retrieve remote rules.\n"); - } - #endif - - if (nxagentOption(ClientOs) == ClientOsLinux && - drules != NULL && dmodel != NULL && - (strcmp(drules, "evdev") == 0 || - strcmp(dmodel, "evdev") == 0)) - { - nxagentKeycodeConversion = 1; - } - - if (drules != NULL) - { - XFree(drules); - } -} - -void nxagentResetKeycodeConversion(void) -{ - int result; - XkbAgentInfoRec info; - - result = XkbQueryExtension(nxagentDisplay, &info.Opcode, &info.EventBase, - &info.ErrorBase, &info.MajorVersion, - &info.MinorVersion); - - if (result != 0) - { - nxagentKeycodeConversionSetup(); - } - else - { - #ifdef WARNING - fprintf(stderr, "nxagentResetKeycodeConversion: " - "WARNING! Failed to query XKB extension.\n"); - #endif - - nxagentKeycodeConversion = 0; - } -} - #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h index 50dd2be78..f292402d2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h @@ -109,10 +109,6 @@ void nxagentEnableXkbExtension(void); void nxagentTuneXkbWrapper(void); -void nxagentResetKeycodeConversion(void); - #endif -CARD8 nxagentConvertKeycode(CARD8 k); - #endif /* __Keyboard_H__ */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c index 762ab79dc..ea06913f8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c @@ -31,12 +31,6 @@ extern Bool nxagentWMIsRunning; extern Bool nxagentIpaq; -#ifdef NX_DEBUG_INPUT -int nxagentDebugInputDevices = 0; -unsigned long nxagentLastInputDevicesDumpTime = 0; -extern void nxagentDeactivateInputDevicesGrabs(); -#endif - /* * Set here the required log level. */ @@ -215,53 +209,6 @@ int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) } #endif - - #ifdef NX_DEBUG_INPUT - - case XK_X: - case XK_x: - { - /* - * Used to test the input devices state. - */ - - if (X -> type == KeyPress) - { - if (nxagentDebugInputDevices == 0) - { - fprintf(stderr, "Info: Turning input devices debug ON.\n"); - - nxagentDebugInputDevices = 1; - } - else - { - fprintf(stderr, "Info: Turning input devices debug OFF.\n"); - - nxagentDebugInputDevices = 0; - - nxagentLastInputDevicesDumpTime = 0; - } - } - - return 1; - } - - case XK_Y: - case XK_y: - { - /* - * Used to deactivate input devices grab. - */ - - if (X -> type == KeyPress) - { - nxagentDeactivateInputDevicesGrabs(); - } - - return 1; - } - - #endif } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c index ca8cfc12f..64dbe3b42 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c @@ -39,11 +39,6 @@ AgentOptionsRec nxagentOptionsBackup; AgentOptionsPtr nxagentOptionsPtr = &nxagentOptions; /* - * If this is set, print the geometry in the block handler. - */ - -unsigned int nxagentPrintGeometryFlags = 0; -/* * This must be called at startup to initialize * the options repository to the default values. */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.h b/nx-X11/programs/Xserver/hw/nxagent/Options.h index af437cd16..aa78489b1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.h @@ -29,8 +29,6 @@ #define UNDEFINED -1 #define COPY_UNLIMITED -1 -extern unsigned int nxagentPrintGeometryFlags; - typedef enum _BackingStoreMode { BackingStoreUndefined = -1, diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index f73d4692c..ce3e6ee05 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -257,11 +257,7 @@ TODO: This should be reset only when if ((dispatchException & DE_TERMINATE) == 0) { - #ifdef NX_DEBUG_INPUT - fprintf(stderr, "Session: Session suspended at '%s' timestamp [%lu].\n", GetTimeAsString(), GetTimeInMillis()); - #else fprintf(stderr, "Session: Session suspended at '%s'.\n", GetTimeAsString()); - #endif } nxagentResetDisplayHandlers(); @@ -551,29 +547,28 @@ Bool nxagentReconnectSession(void) goto nxagentReconnectError; } - if (nxagentOption(ResetKeyboardAtResume) == 1 && - (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL || - strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 || - strcmp(nxagentKeyboard, "query") == 0)) + if (nxagentOption(ResetKeyboardAtResume)) { - if (nxagentResetKeyboard() == 0) + if (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL || + strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 || + strcmp(nxagentKeyboard, "query") == 0) { - #ifdef WARNING - if (nxagentVerbose == 1) + + if (nxagentResetKeyboard() == 0) { - fprintf(stderr, "nxagentReconnect: Failed to reset keyboard device.\n"); - } - #endif + #ifdef WARNING + if (nxagentVerbose == 1) + { + fprintf(stderr, "nxagentReconnect: Failed to reset keyboard device.\n"); + } + #endif - failedStep = WINDOW_STEP; + failedStep = WINDOW_STEP; - goto nxagentReconnectError; + goto nxagentReconnectError; + } } } - else - { - nxagentResetKeycodeConversion(); - } nxagentXkbState.Initialized = 0; @@ -613,11 +608,7 @@ Bool nxagentReconnectSession(void) goto nxagentReconnectError; } - #ifdef NX_DEBUG_INPUT - fprintf(stderr, "Session: Session resumed at '%s' timestamp [%lu].\n", GetTimeAsString(), GetTimeInMillis()); - #else fprintf(stderr, "Session: Session resumed at '%s'.\n", GetTimeAsString()); - #endif nxagentRemoveSplashWindow(NULL); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index f2d7b15f9..b1ff219e7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -2270,7 +2270,8 @@ void nxagentAddGlyphs(GlyphSetPtr glyphSet, Glyph *gids, xGlyphInfo *gi, normalizedImages = NULL; - if (sizeImages > 0) + if (glyphDepths[glyphSet -> fdepth] == 1 && + nxagentServerOrder() != BitmapBitOrder(nxagentDisplay)) { normalizedImages = xalloc(sizeImages); @@ -2278,11 +2279,7 @@ void nxagentAddGlyphs(GlyphSetPtr glyphSet, Glyph *gids, xGlyphInfo *gi, { memcpy(normalizedImages, images, sizeImages); - if (glyphDepths[glyphSet -> fdepth] == 1 && - nxagentServerOrder() != BitmapBitOrder(nxagentDisplay)) - { - BitOrderInvert ((unsigned char *) normalizedImages, sizeImages); - } + BitOrderInvert ((unsigned char *) normalizedImages, sizeImages); } else { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c index e192cd2c4..79cb74efa 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c @@ -60,27 +60,6 @@ typedef struct } nxagentWMHints; -/* - * This structure is compatible with 32 - * and 64 bit library interface. It has - * been copied from Xatomtype.h and it's - * a parameter of XChangeProperty(). - */ - -typedef struct -{ - unsigned long flags; - long input; - long initialState; - unsigned long iconPixmap; - unsigned long iconWindow; - long iconX; - long iconY; - unsigned long iconMask; - unsigned long windowGroup; -} -nxagentPropWMHints; - WindowPtr nxagentRootlessWindow = NULL; #define TOP_LEVEL_TABLE_UNIT 100 @@ -450,7 +429,6 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) Atom propertyX, typeX; char *output = NULL; nxagentWMHints wmHints; - nxagentPropWMHints propHints; Bool export = False; Bool freeMem = False; @@ -511,22 +489,8 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) wmHints.flags |= InputHint; wmHints.input = True; - /* - * Initialize the structure used in XChangeProperty(). - */ - - propHints.flags = wmHints.flags; - propHints.input = (wmHints.input == True ? 1 : 0); - propHints.initialState = wmHints.initial_state; - propHints.iconPixmap = wmHints.icon_pixmap; - propHints.iconWindow = wmHints.icon_window; - propHints.iconX = wmHints.icon_x; - propHints.iconY = wmHints.icon_y; - propHints.iconMask = wmHints.icon_mask; - propHints.windowGroup = wmHints.window_group; - - output = (char*) &propHints; - export = True; + output = (char*) &wmHints; + export = True; if ((wmHints.flags & IconPixmapHint) && (wmHints.icon_pixmap != None)) { @@ -540,17 +504,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) nxagentSynchronizeRegion((DrawablePtr) icon, NullRegion, NEVER_BREAK, NULL); } - propHints.iconPixmap = nxagentPixmap(icon); + wmHints.icon_pixmap = nxagentPixmap(icon); } else { - propHints.flags &= ~IconPixmapHint; + wmHints.flags &= ~IconPixmapHint; #ifdef WARNING fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon pixmap %x from hint " "exporting property %s type %s on window %p.\n", (unsigned int) wmHints.icon_pixmap, propertyS, typeS, - (void *) pWin); + (void*)pWin); #endif } } @@ -562,17 +526,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) if (icon) { - propHints.iconWindow = nxagentWindow(icon); + wmHints.icon_window = nxagentWindow(icon); } else { - propHints.flags &= ~IconWindowHint; + wmHints.flags &= ~IconWindowHint; #ifdef WARNING fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon window %x from hint " "exporting property %s type %s on window %p.\n", (unsigned int) wmHints.icon_window, propertyS, typeS, - (void *) pWin); + (void*)pWin); #endif } } @@ -584,17 +548,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) if (icon) { - propHints.iconMask = nxagentPixmap(icon); + wmHints.icon_mask = nxagentPixmap(icon); } else { - propHints.flags &= ~IconMaskHint; + wmHints.flags &= ~IconMaskHint; #ifdef WARNING fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon mask %x from hint " "exporting property %s type %s on window %p.\n", (unsigned int) wmHints.icon_mask, propertyS, typeS, - (void *) pWin); + (void*)pWin); #endif } } @@ -606,17 +570,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) if (window) { - propHints.windowGroup = nxagentWindow(window); + wmHints.window_group = nxagentWindow(window); } else { - propHints.flags &= ~WindowGroupHint; + wmHints.flags &= ~WindowGroupHint; #ifdef WARNING fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up window group %x from hint " "exporting property %s type %s on window %p.\n", (unsigned int) wmHints.window_group, propertyS, typeS, - (void *) pWin); + (void*)pWin); #endif } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index f643cb98c..524bafd10 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -2373,7 +2373,8 @@ FIXME: We should try to restore the previously nxagentPrintAgentGeometry("After Resize Screen", "nxagentResizeScreen:"); #endif - nxagentSetPrintGeometry(pScreen -> myNum); + fprintf(stderr, "Info: Screen [%d] resized to geometry [%dx%d].\n", + pScreen -> myNum, width, height); return 1; @@ -3045,7 +3046,7 @@ void nxagentShadowAdaptDepth(unsigned int width, unsigned int height, #ifdef WARNING fprintf(stderr, "nxagentCorrectDepthShadow: WARNING! Visual not found. Using default visual.\n"); #endif - + pVisual = nxagentVisuals[nxagentDefaultVisualIndex].visual; } @@ -3472,10 +3473,10 @@ int nxagentRRSetScreenConfig(ScreenPtr pScreen, int width, int height) RRScreenSizePtr oldSizes; pScrPriv = rrGetScrPriv(pScreen); - + oldWidth = pScreen->width; oldHeight = pScreen->height; - + if (!pScrPriv) { return 1; @@ -3555,7 +3556,7 @@ int nxagentRRSetScreenConfig(ScreenPtr pScreen, int width, int height) } RREditConnectionInfo (pScreen); - + /* * Fix pointer bounds and location */ @@ -3693,8 +3694,7 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg, return; } -void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, - int yorg, WindowPtr pWin) +void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, int yorg, WindowPtr pWin) { PixmapPtr pVirtualPixmap; RegionPtr clipRegion; @@ -3710,14 +3710,6 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, BoxRec extents; miBSWindowPtr pBackingStore; - /* - * Limit the area to restore to the - * root window size. - */ - - REGION_INTERSECT(pWin -> pScreen, prgnRestore, prgnRestore, - &WindowTable[pWin -> drawable.pScreen -> myNum] -> winSize); - pBackingStore = (miBSWindowPtr) pWin -> backStorage; pVirtualPixmap = nxagentVirtualPixmap(pPixmap); @@ -3911,24 +3903,6 @@ void nxagentShadowAdaptToRatio(void) REGION_UNINIT(pScreen, ®ion); } -void nxagentPrintGeometry() -{ - int i; - - for (i = 0; i < screenInfo.numScreens; i++) - { - if (nxagentPrintGeometryFlags && (1 << i)) - { - fprintf(stderr, "Info: Screen [%d] resized to geometry [%dx%d] " - "fullscreen [%d].\n", i, screenInfo.screens[i] -> width, - screenInfo.screens[i] -> height, - nxagentOption(Fullscreen)); - } - } - - nxagentPrintGeometryFlags = 0; -} - #ifdef DUMP void nxagentShowPixmap(PixmapPtr pPixmap, int x, int y, int width, int height) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.h b/nx-X11/programs/Xserver/hw/nxagent/Screen.h index 73af3cc50..3550dd553 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.h @@ -36,9 +36,6 @@ is" without express or implied warranty. #define MIN_NXAGENT_HEIGHT 60 #define NXAGENT_FRAME_WIDTH 2000 -#define nxagentSetPrintGeometry(screen) \ - nxagentPrintGeometryFlags = (1 << (screen)); - extern int nxagentClients; extern int nxagentAutoDisconnectTimeout; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 8c94b24b5..8da5d8bd1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -908,8 +908,6 @@ void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn) XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, nxagentOption(Width), nxagentOption(Height)); - - nxagentSetPrintGeometry(pScreen -> myNum); } #ifdef VIEWPORT_FRAME diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c index d267adbc9..f84ca0e03 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c @@ -515,11 +515,7 @@ Dispatch(void) if (serverGeneration > nxagentMaxAllowedResets) { - #ifdef NX_DEBUG_INPUT - fprintf(stderr, "Session: Session started at '%s' timestamp [%lu].\n", GetTimeAsString(), GetTimeInMillis()); - #else fprintf(stderr, "Session: Session started at '%s'.\n", GetTimeAsString()); - #endif nxagentSessionState = SESSION_UP; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c.NX.original index d267adbc9..f84ca0e03 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c.NX.original @@ -515,11 +515,7 @@ Dispatch(void) if (serverGeneration > nxagentMaxAllowedResets) { - #ifdef NX_DEBUG_INPUT - fprintf(stderr, "Session: Session started at '%s' timestamp [%lu].\n", GetTimeAsString(), GetTimeInMillis()); - #else fprintf(stderr, "Session: Session started at '%s'.\n", GetTimeAsString()); - #endif nxagentSessionState = SESSION_UP; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c index 1c141c015..91e290996 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c @@ -189,11 +189,6 @@ xEvent *xeviexE; #include "Windows.h" #include "Args.h" -#ifdef NX_DEBUG_INPUT -extern int nxagentDebugInput; -extern int nxagentDebugInputDevices; -#endif - extern Display *nxagentDisplay; extern WindowPtr nxagentLastEnteredWindow; @@ -1687,28 +1682,11 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, int i; int type; -#ifdef NX_DEBUG_INPUT - if (grab && nxagentDebugInput && grab->window) - { - fprintf(stderr, "TryClientEvents: Grab window is [0x%x].\n", - (unsigned int)grab->window->drawable.id); - if (!SameClient(grab, client)) - fprintf(stderr, "TryClientEvents: Events are going to be " - "discarded.\n"); - } -#endif -#if defined(DEBUG) || defined(NX_DEBUG_INPUT) -#ifdef NX_DEBUG_INPUT - if (nxagentDebugInput == 1) - fprintf(stderr, "Event([%d, %d], mask=0x%x), client=%d", - pEvents->u.u.type, pEvents->u.u.detail, (unsigned int)mask, - client->index); -#else +#ifdef DEBUG if (debug_events) ErrorF( "Event([%d, %d], mask=0x%x), client=%d", pEvents->u.u.type, pEvents->u.u.detail, mask, client->index); #endif -#endif if ((client) && (client != serverClient) && (!client->clientGone) && ((filter == CantBeFiltered) || (mask & filter))) { @@ -1722,17 +1700,10 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, if (WID(inputInfo.pointer->valuator->motionHintWindow) == pEvents->u.keyButtonPointer.event) { -#if defined(DEBUG) || defined(NX_DEBUG_INPUT) -#ifdef NX_DEBUG_INPUT - if (nxagentDebugInput == 1) - { - fprintf(stderr,"\nmotionHintWindow == keyButtonPointer.event\n"); - } -#else +#ifdef DEBUG if (debug_events) ErrorF("\n"); fprintf(stderr,"motionHintWindow == keyButtonPointer.event\n"); #endif -#endif return 1; /* don't send, but pretend we did */ } pEvents->u.u.detail = NotifyHint; @@ -1769,26 +1740,16 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, } WriteEventsToClient(client, count, pEvents); -#if defined(DEBUG) || defined(NX_DEBUG_INPUT) -#ifdef NX_DEBUG_INPUT - if (nxagentDebugInput == 1) - fprintf(stderr, " delivered\n"); -#else +#ifdef DEBUG if (debug_events) ErrorF( " delivered\n"); #endif -#endif return 1; } else { -#if defined(DEBUG) || defined(NX_DEBUG_INPUT) -#ifdef NX_DEBUG_INPUT - if (nxagentDebugInput == 1) - fprintf(stderr, "\n"); -#else +#ifdef DEBUG if (debug_events) ErrorF("\n"); #endif -#endif return 0; } } @@ -1866,12 +1827,6 @@ DeliverEventsToWindow(register WindowPtr pWin, xEvent *pEvents, int count, tempGrab.pointerMode = GrabModeAsync; tempGrab.confineTo = NullWindow; tempGrab.cursor = NullCursor; - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "DeliverEventsToWindow: Activating passive grab on pointer.\n"); - } - #endif (*inputInfo.pointer->ActivateGrab)(inputInfo.pointer, &tempGrab, currentTime, TRUE); } @@ -2742,13 +2697,6 @@ CheckPassiveGrabsOnWindow( tempGrab.modifiersDetail.exact&(~0x1f00); } #endif - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "CheckPassiveGrabsOnWindow: Activating passive grab on %s.\n", - device == inputInfo.keyboard ? "keyboard" : "pointer"); - } - #endif (*device->ActivateGrab)(device, grab, currentTime, TRUE); FixUpEventFromWindow(xE, grab->window, None, TRUE); @@ -3107,17 +3055,7 @@ drawable.id:0; else DeliverFocusedEvent(keybd, xE, sprite.win, count); if (deactivateGrab) - #ifdef NX_DEBUG_INPUT - { - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcessKeyboardEvent: Deactivating grab on keyboard.\n"); - } - #endif (*keybd->DeactivateGrab)(keybd); - #ifdef NX_DEBUG_INPUT - } - #endif } #ifdef XKB @@ -3178,12 +3116,6 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count xevieEventSent = 0; else { xeviemouse = mouse; - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInput == 1) - { - fprintf(stderr, "ProcessPointerEvent: Going to send XEVIE event.\n"); - } - #endif WriteToClient(clients[xevieClientIndex], sizeof(xEvent), (char *)xE); return; } @@ -3238,38 +3170,14 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count #if !defined(XFree86Server) || !defined(XINPUT) xE->u.u.detail = butc->map[key]; #endif - #ifdef NX_DEBUG_INPUT - if (xE->u.u.detail == 0) - { - if (nxagentDebugInput == 1) - { - fprintf(stderr, "ProcessPointerEvent: WARNING! detail == 0" - " for ButtonPress.\n"); - } - return; - } - #else if (xE->u.u.detail == 0) return; - #endif if (xE->u.u.detail <= 5) butc->state |= (Button1Mask >> 1) << xE->u.u.detail; filters[MotionNotify] = Motion_Filter(butc); if (!grab) - #ifdef NX_DEBUG_INPUT if (CheckDeviceGrabs(mouse, xE, 0, count)) - { - if (nxagentDebugInput == 1) - { - fprintf(stderr, "ProcessPointerEvent: CheckDeviceGrabs" - " returned True for ButtonPress.\n"); - } return; - } - #else - if (CheckDeviceGrabs(mouse, xE, 0, count)) - return; - #endif break; case ButtonRelease: mouse->valuator->motionHintWindow = NullWindow; @@ -3281,20 +3189,8 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count #if !defined(XFree86Server) || !defined(XINPUT) xE->u.u.detail = butc->map[key]; #endif - #ifdef NX_DEBUG_INPUT - if (xE->u.u.detail == 0) - { - if (nxagentDebugInput == 1) - { - fprintf(stderr, "ProcessPointerEvent: WARNING! detail == 0" - " for ButtonRelease.\n"); - } - return; - } - #else if (xE->u.u.detail == 0) return; - #endif if (xE->u.u.detail <= 5) butc->state &= ~((Button1Mask >> 1) << xE->u.u.detail); filters[MotionNotify] = Motion_Filter(butc); @@ -3305,36 +3201,6 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count FatalError("bogus pointer event from ddx"); } } - #ifdef NX_DEBUG_INPUT - else if (!CheckMotion(xE)) - { - if (nxagentDebugInput == 1) - { - fprintf(stderr, "ProcessPointerEvent: CheckMotion returned False" - " for MotionNotify.\n"); - } - return; - } - if (grab) - { - if (nxagentDebugInput == 1) - { - fprintf(stderr, "ProcessPointerEvent: Going to deliver grabbed " - "events (count = %d).\n", count); - } - DeliverGrabbedEvent(xE, mouse, deactivateGrab, count); - } - else - { - if (nxagentDebugInput == 1) - { - fprintf(stderr, "ProcessPointerEvent: Going to deliver device " - "events (count = %d).\n", count); - } - DeliverDeviceEvents(sprite.win, xE, NullGrab, NullWindow, - mouse, count); - } - #else else if (!CheckMotion(xE)) return; if (grab) @@ -3342,19 +3208,8 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count else DeliverDeviceEvents(sprite.win, xE, NullGrab, NullWindow, mouse, count); - #endif if (deactivateGrab) - #ifdef NX_DEBUG_INPUT - { - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcessPointerEvent: Deactivating grab on pointer.\n"); - } - #endif (*mouse->DeactivateGrab)(mouse); - #ifdef NX_DEBUG_INPUT - } - #endif } #define AtMostOneClient \ @@ -4075,12 +3930,6 @@ ProcGrabPointer(ClientPtr client) pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); if (!pWin) return BadWindow; - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcGrabPointer: pWin [%p] client [%d].\n", pWin, client -> index); - } - #endif if (stuff->confineTo == None) confineTo = NullWindow; else @@ -4140,12 +3989,6 @@ ProcGrabPointer(ClientPtr client) tempGrab.keyboardMode = stuff->keyboardMode; tempGrab.pointerMode = stuff->pointerMode; tempGrab.device = device; - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcGrabPointer: Activating active grab on pointer.\n"); - } - #endif (*device->ActivateGrab)(device, &tempGrab, time, FALSE); if (oldCursor) FreeCursor (oldCursor, (Cursor)0); @@ -4209,12 +4052,6 @@ ProcUngrabPointer(ClientPtr client) TimeStamp time; REQUEST(xResourceReq); - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcUngrabPointer: client [%d].\n", client -> index); - } - #endif REQUEST_SIZE_MATCH(xResourceReq); UpdateCurrentTime(); grab = device->grab; @@ -4222,25 +4059,7 @@ ProcUngrabPointer(ClientPtr client) if ((CompareTimeStamps(time, currentTime) != LATER) && (CompareTimeStamps(time, device->grabTime) != EARLIER) && (grab) && SameClient(grab, client)) - #ifdef NX_DEBUG_INPUT - { - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcUngrabPointer: Deactivating grab on pointer.\n"); - } - #endif (*device->DeactivateGrab)(device); - #ifdef NX_DEBUG_INPUT - } - else - { - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcUngrabPointer: current time [%lu] request time [%lu] grab time [%lu].\n", - currentTime.milliseconds, time.milliseconds, device->grabTime.milliseconds); - } - } - #endif return Success; } @@ -4295,12 +4114,6 @@ GrabDevice(register ClientPtr client, register DeviceIntPtr dev, tempGrab.pointerMode = other_mode; tempGrab.eventMask = mask; tempGrab.device = dev; - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "GrabDevice: Activating active grab on keyboard.\n"); - } - #endif (*dev->ActivateGrab)(dev, &tempGrab, time, FALSE); *status = GrabSuccess; } @@ -4314,12 +4127,6 @@ ProcGrabKeyboard(ClientPtr client) REQUEST(xGrabKeyboardReq); int result; - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcGrabKeyboard: client [%d].\n", client -> index); - } - #endif REQUEST_SIZE_MATCH(xGrabKeyboardReq); #ifdef XCSECURITY if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard, TRUE)) @@ -4350,12 +4157,6 @@ ProcUngrabKeyboard(ClientPtr client) TimeStamp time; REQUEST(xResourceReq); - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcUngrabKeyboard: client [%d].\n", client -> index); - } - #endif REQUEST_SIZE_MATCH(xResourceReq); UpdateCurrentTime(); grab = device->grab; @@ -4363,25 +4164,7 @@ ProcUngrabKeyboard(ClientPtr client) if ((CompareTimeStamps(time, currentTime) != LATER) && (CompareTimeStamps(time, device->grabTime) != EARLIER) && (grab) && SameClient(grab, client)) - #ifdef NX_DEBUG_INPUT - { - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcUngrabKeyboard: Deactivating grab on keyboard.\n"); - } - #endif (*device->DeactivateGrab)(device); - #ifdef NX_DEBUG_INPUT - } - else - { - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcUngrabKeyboard: current time [%lu] request time [%lu] grab time [%lu].\n", - currentTime.milliseconds, time.milliseconds, device->grabTime.milliseconds); - } - } - #endif return Success; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original index 1c141c015..91e290996 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original @@ -189,11 +189,6 @@ xEvent *xeviexE; #include "Windows.h" #include "Args.h" -#ifdef NX_DEBUG_INPUT -extern int nxagentDebugInput; -extern int nxagentDebugInputDevices; -#endif - extern Display *nxagentDisplay; extern WindowPtr nxagentLastEnteredWindow; @@ -1687,28 +1682,11 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, int i; int type; -#ifdef NX_DEBUG_INPUT - if (grab && nxagentDebugInput && grab->window) - { - fprintf(stderr, "TryClientEvents: Grab window is [0x%x].\n", - (unsigned int)grab->window->drawable.id); - if (!SameClient(grab, client)) - fprintf(stderr, "TryClientEvents: Events are going to be " - "discarded.\n"); - } -#endif -#if defined(DEBUG) || defined(NX_DEBUG_INPUT) -#ifdef NX_DEBUG_INPUT - if (nxagentDebugInput == 1) - fprintf(stderr, "Event([%d, %d], mask=0x%x), client=%d", - pEvents->u.u.type, pEvents->u.u.detail, (unsigned int)mask, - client->index); -#else +#ifdef DEBUG if (debug_events) ErrorF( "Event([%d, %d], mask=0x%x), client=%d", pEvents->u.u.type, pEvents->u.u.detail, mask, client->index); #endif -#endif if ((client) && (client != serverClient) && (!client->clientGone) && ((filter == CantBeFiltered) || (mask & filter))) { @@ -1722,17 +1700,10 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, if (WID(inputInfo.pointer->valuator->motionHintWindow) == pEvents->u.keyButtonPointer.event) { -#if defined(DEBUG) || defined(NX_DEBUG_INPUT) -#ifdef NX_DEBUG_INPUT - if (nxagentDebugInput == 1) - { - fprintf(stderr,"\nmotionHintWindow == keyButtonPointer.event\n"); - } -#else +#ifdef DEBUG if (debug_events) ErrorF("\n"); fprintf(stderr,"motionHintWindow == keyButtonPointer.event\n"); #endif -#endif return 1; /* don't send, but pretend we did */ } pEvents->u.u.detail = NotifyHint; @@ -1769,26 +1740,16 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, } WriteEventsToClient(client, count, pEvents); -#if defined(DEBUG) || defined(NX_DEBUG_INPUT) -#ifdef NX_DEBUG_INPUT - if (nxagentDebugInput == 1) - fprintf(stderr, " delivered\n"); -#else +#ifdef DEBUG if (debug_events) ErrorF( " delivered\n"); #endif -#endif return 1; } else { -#if defined(DEBUG) || defined(NX_DEBUG_INPUT) -#ifdef NX_DEBUG_INPUT - if (nxagentDebugInput == 1) - fprintf(stderr, "\n"); -#else +#ifdef DEBUG if (debug_events) ErrorF("\n"); #endif -#endif return 0; } } @@ -1866,12 +1827,6 @@ DeliverEventsToWindow(register WindowPtr pWin, xEvent *pEvents, int count, tempGrab.pointerMode = GrabModeAsync; tempGrab.confineTo = NullWindow; tempGrab.cursor = NullCursor; - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "DeliverEventsToWindow: Activating passive grab on pointer.\n"); - } - #endif (*inputInfo.pointer->ActivateGrab)(inputInfo.pointer, &tempGrab, currentTime, TRUE); } @@ -2742,13 +2697,6 @@ CheckPassiveGrabsOnWindow( tempGrab.modifiersDetail.exact&(~0x1f00); } #endif - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "CheckPassiveGrabsOnWindow: Activating passive grab on %s.\n", - device == inputInfo.keyboard ? "keyboard" : "pointer"); - } - #endif (*device->ActivateGrab)(device, grab, currentTime, TRUE); FixUpEventFromWindow(xE, grab->window, None, TRUE); @@ -3107,17 +3055,7 @@ drawable.id:0; else DeliverFocusedEvent(keybd, xE, sprite.win, count); if (deactivateGrab) - #ifdef NX_DEBUG_INPUT - { - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcessKeyboardEvent: Deactivating grab on keyboard.\n"); - } - #endif (*keybd->DeactivateGrab)(keybd); - #ifdef NX_DEBUG_INPUT - } - #endif } #ifdef XKB @@ -3178,12 +3116,6 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count xevieEventSent = 0; else { xeviemouse = mouse; - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInput == 1) - { - fprintf(stderr, "ProcessPointerEvent: Going to send XEVIE event.\n"); - } - #endif WriteToClient(clients[xevieClientIndex], sizeof(xEvent), (char *)xE); return; } @@ -3238,38 +3170,14 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count #if !defined(XFree86Server) || !defined(XINPUT) xE->u.u.detail = butc->map[key]; #endif - #ifdef NX_DEBUG_INPUT - if (xE->u.u.detail == 0) - { - if (nxagentDebugInput == 1) - { - fprintf(stderr, "ProcessPointerEvent: WARNING! detail == 0" - " for ButtonPress.\n"); - } - return; - } - #else if (xE->u.u.detail == 0) return; - #endif if (xE->u.u.detail <= 5) butc->state |= (Button1Mask >> 1) << xE->u.u.detail; filters[MotionNotify] = Motion_Filter(butc); if (!grab) - #ifdef NX_DEBUG_INPUT if (CheckDeviceGrabs(mouse, xE, 0, count)) - { - if (nxagentDebugInput == 1) - { - fprintf(stderr, "ProcessPointerEvent: CheckDeviceGrabs" - " returned True for ButtonPress.\n"); - } return; - } - #else - if (CheckDeviceGrabs(mouse, xE, 0, count)) - return; - #endif break; case ButtonRelease: mouse->valuator->motionHintWindow = NullWindow; @@ -3281,20 +3189,8 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count #if !defined(XFree86Server) || !defined(XINPUT) xE->u.u.detail = butc->map[key]; #endif - #ifdef NX_DEBUG_INPUT - if (xE->u.u.detail == 0) - { - if (nxagentDebugInput == 1) - { - fprintf(stderr, "ProcessPointerEvent: WARNING! detail == 0" - " for ButtonRelease.\n"); - } - return; - } - #else if (xE->u.u.detail == 0) return; - #endif if (xE->u.u.detail <= 5) butc->state &= ~((Button1Mask >> 1) << xE->u.u.detail); filters[MotionNotify] = Motion_Filter(butc); @@ -3305,36 +3201,6 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count FatalError("bogus pointer event from ddx"); } } - #ifdef NX_DEBUG_INPUT - else if (!CheckMotion(xE)) - { - if (nxagentDebugInput == 1) - { - fprintf(stderr, "ProcessPointerEvent: CheckMotion returned False" - " for MotionNotify.\n"); - } - return; - } - if (grab) - { - if (nxagentDebugInput == 1) - { - fprintf(stderr, "ProcessPointerEvent: Going to deliver grabbed " - "events (count = %d).\n", count); - } - DeliverGrabbedEvent(xE, mouse, deactivateGrab, count); - } - else - { - if (nxagentDebugInput == 1) - { - fprintf(stderr, "ProcessPointerEvent: Going to deliver device " - "events (count = %d).\n", count); - } - DeliverDeviceEvents(sprite.win, xE, NullGrab, NullWindow, - mouse, count); - } - #else else if (!CheckMotion(xE)) return; if (grab) @@ -3342,19 +3208,8 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count else DeliverDeviceEvents(sprite.win, xE, NullGrab, NullWindow, mouse, count); - #endif if (deactivateGrab) - #ifdef NX_DEBUG_INPUT - { - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcessPointerEvent: Deactivating grab on pointer.\n"); - } - #endif (*mouse->DeactivateGrab)(mouse); - #ifdef NX_DEBUG_INPUT - } - #endif } #define AtMostOneClient \ @@ -4075,12 +3930,6 @@ ProcGrabPointer(ClientPtr client) pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); if (!pWin) return BadWindow; - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcGrabPointer: pWin [%p] client [%d].\n", pWin, client -> index); - } - #endif if (stuff->confineTo == None) confineTo = NullWindow; else @@ -4140,12 +3989,6 @@ ProcGrabPointer(ClientPtr client) tempGrab.keyboardMode = stuff->keyboardMode; tempGrab.pointerMode = stuff->pointerMode; tempGrab.device = device; - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcGrabPointer: Activating active grab on pointer.\n"); - } - #endif (*device->ActivateGrab)(device, &tempGrab, time, FALSE); if (oldCursor) FreeCursor (oldCursor, (Cursor)0); @@ -4209,12 +4052,6 @@ ProcUngrabPointer(ClientPtr client) TimeStamp time; REQUEST(xResourceReq); - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcUngrabPointer: client [%d].\n", client -> index); - } - #endif REQUEST_SIZE_MATCH(xResourceReq); UpdateCurrentTime(); grab = device->grab; @@ -4222,25 +4059,7 @@ ProcUngrabPointer(ClientPtr client) if ((CompareTimeStamps(time, currentTime) != LATER) && (CompareTimeStamps(time, device->grabTime) != EARLIER) && (grab) && SameClient(grab, client)) - #ifdef NX_DEBUG_INPUT - { - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcUngrabPointer: Deactivating grab on pointer.\n"); - } - #endif (*device->DeactivateGrab)(device); - #ifdef NX_DEBUG_INPUT - } - else - { - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcUngrabPointer: current time [%lu] request time [%lu] grab time [%lu].\n", - currentTime.milliseconds, time.milliseconds, device->grabTime.milliseconds); - } - } - #endif return Success; } @@ -4295,12 +4114,6 @@ GrabDevice(register ClientPtr client, register DeviceIntPtr dev, tempGrab.pointerMode = other_mode; tempGrab.eventMask = mask; tempGrab.device = dev; - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "GrabDevice: Activating active grab on keyboard.\n"); - } - #endif (*dev->ActivateGrab)(dev, &tempGrab, time, FALSE); *status = GrabSuccess; } @@ -4314,12 +4127,6 @@ ProcGrabKeyboard(ClientPtr client) REQUEST(xGrabKeyboardReq); int result; - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcGrabKeyboard: client [%d].\n", client -> index); - } - #endif REQUEST_SIZE_MATCH(xGrabKeyboardReq); #ifdef XCSECURITY if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard, TRUE)) @@ -4350,12 +4157,6 @@ ProcUngrabKeyboard(ClientPtr client) TimeStamp time; REQUEST(xResourceReq); - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcUngrabKeyboard: client [%d].\n", client -> index); - } - #endif REQUEST_SIZE_MATCH(xResourceReq); UpdateCurrentTime(); grab = device->grab; @@ -4363,25 +4164,7 @@ ProcUngrabKeyboard(ClientPtr client) if ((CompareTimeStamps(time, currentTime) != LATER) && (CompareTimeStamps(time, device->grabTime) != EARLIER) && (grab) && SameClient(grab, client)) - #ifdef NX_DEBUG_INPUT - { - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcUngrabKeyboard: Deactivating grab on keyboard.\n"); - } - #endif (*device->DeactivateGrab)(device); - #ifdef NX_DEBUG_INPUT - } - else - { - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcUngrabKeyboard: current time [%lu] request time [%lu] grab time [%lu].\n", - currentTime.milliseconds, time.milliseconds, device->grabTime.milliseconds); - } - } - #endif return Success; } |