Commit 45b970f2 authored by Reinhard Tartler's avatar Reinhard Tartler

Imported nxagent-3.3.0-6.tar.gz

Summary: Imported nxagent-3.3.0-6.tar.gz Keywords: Imported nxagent-3.3.0-6.tar.gz into Git repository
parent 22914447
ChangeLog: 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 nxagent-3.3.0-6
- Fixed compile warnings. - Fixed compile warnings.
......
...@@ -681,30 +681,6 @@ void nxagentCollectPropertyEvent(int resource) ...@@ -681,30 +681,6 @@ void nxagentCollectPropertyEvent(int resource)
return; 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) switch (lastClientStage)
{ {
case SelectionStageWaitSize: case SelectionStageWaitSize:
......
...@@ -291,21 +291,10 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen) ...@@ -291,21 +291,10 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen)
pCmap = (ColormapPtr)LookupIDByType(pScreen->defColormap, pCmap = (ColormapPtr)LookupIDByType(pScreen->defColormap,
RT_COLORMAP); RT_COLORMAP);
if (pCmap != NULL)
{
XSetWindowColormap(nxagentDisplay, XSetWindowColormap(nxagentDisplay,
nxagentDefaultWindows[pScreen->myNum], nxagentDefaultWindows[pScreen->myNum],
nxagentColormap(pCmap)); nxagentColormap(pCmap));
} }
#ifdef WARNING
else
{
fprintf(stderr, "nxagentSetInstalledColormapWindows: WARNING! "
"Window at [%p] has no colormap with class [%d].\n",
pWin, pWin -> drawable.class);
}
#endif
}
#endif /* DUMB_WINDOW_MANAGERS */ #endif /* DUMB_WINDOW_MANAGERS */
} }
else else
......
...@@ -42,7 +42,7 @@ extern int nxagentKillDialogPid; ...@@ -42,7 +42,7 @@ extern int nxagentKillDialogPid;
extern int nxagentSuspendDialogPid; extern int nxagentSuspendDialogPid;
extern int nxagentRootlessDialogPid; extern int nxagentRootlessDialogPid;
extern int nxagentPulldownDialogPid; extern int nxagentPulldownDialogPid;
extern int nxagentFontsReplacementDialogPid; extern int nxagentFontsReplacement;
extern int nxagentEnableRandRModeDialogPid; extern int nxagentEnableRandRModeDialogPid;
extern int nxagentDisableRandRModeDialogPid; extern int nxagentDisableRandRModeDialogPid;
extern int nxagentEnableDeferModePid; extern int nxagentEnableDeferModePid;
......
...@@ -453,21 +453,6 @@ static void nxagentSigchldHandler(int signal) ...@@ -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) if (pid == 0 && nxagentEnableRandRModeDialogPid)
{ {
pid = waitpid(nxagentEnableRandRModeDialogPid, &status, options); pid = waitpid(nxagentEnableRandRModeDialogPid, &status, options);
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "Handlers.h" #include "Handlers.h"
#include "Pixels.h" #include "Pixels.h"
#include "Reconnect.h" #include "Reconnect.h"
#include "GCOps.h"
#include "NXlib.h" #include "NXlib.h"
...@@ -419,10 +418,9 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned ...@@ -419,10 +418,9 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
if (useStoredBitmap != 0) if (useStoredBitmap != 0)
{ {
#ifdef TEST #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), "[%d,%d,%d,%d] with [%ld] rects.\n", nxagentDrawableType(pDrawable),
(void *) pDrawable, (void *) nxagentDrawableBitmap(pDrawable), (void *) pDrawable, nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.x1,
nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.x1,
nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.y1, nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.y1,
nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.x2, nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.x2,
nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.y2, nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.y2,
...@@ -583,7 +581,8 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned ...@@ -583,7 +581,8 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSynchronizeRegion: Going to synchronize [%ld] rects of [%s] at [%p].\n", 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", fprintf(stderr, "nxagentSynchronizeRegion: Extents geometry [%d,%d,%d,%d].\n",
clipRegion -> extents.x1, clipRegion -> extents.y1, clipRegion -> extents.x2, clipRegion -> extents.y2); clipRegion -> extents.x1, clipRegion -> extents.y1, clipRegion -> extents.x2, clipRegion -> extents.y2);
...@@ -616,22 +615,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned ...@@ -616,22 +615,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
if (data == NULL) if (data == NULL)
{ {
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentSynchronizeRegion: WARNING! Failed to allocate memory for synchronization.\n"); 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 #endif
goto nxagentSynchronizeRegionFree; goto nxagentSynchronizeRegionFree;
...@@ -686,14 +670,10 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned ...@@ -686,14 +670,10 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
if (nxagentDrawableStatus(pDrawable) == Synchronized) if (nxagentDrawableStatus(pDrawable) == Synchronized)
{ {
#ifdef WARNING #ifdef WARNING
if (pDrawable -> type == DRAWABLE_WINDOW && pSrcDrawable != pDrawable) if (pDrawable -> type == DRAWABLE_WINDOW && pSrcDrawable != pDrawable)
{
fprintf(stderr, "nxagentSynchronizeRegion: WARNING! Trying to synchronize " fprintf(stderr, "nxagentSynchronizeRegion: WARNING! Trying to synchronize "
"the clean drawable type [%d] at [%p] with source at [%p].\n", "the clean drawable type [%d] at [%p] with source at [%p].\n",
pDrawable -> type, (void *) pDrawable, (void *) pSrcDrawable); pDrawable -> type, (void *) pDrawable, (void *) pSrcDrawable);
}
#endif #endif
goto nxagentSynchronizeRegionStop; goto nxagentSynchronizeRegionStop;
...@@ -768,6 +748,9 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned ...@@ -768,6 +748,9 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
nxagentGetImage(pSrcDrawable, x, y, w, h, format, AllPlanes, data); 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 * Going to unmark the synchronized
* region. * region.
...@@ -822,13 +805,6 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned ...@@ -822,13 +805,6 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
nxagentUnmarkCorruptedRegion(pDrawable, &tileRegion); 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 else
{ {
...@@ -859,14 +835,6 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned ...@@ -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); REGION_UNINIT(pDrawable -> pScreen, &tileRegion);
#if !defined(COLLECTED_UPDATES) #if !defined(COLLECTED_UPDATES)
...@@ -2587,13 +2555,16 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable) ...@@ -2587,13 +2555,16 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable)
GCPtr pGC = NULL; GCPtr pGC = NULL;
RegionPtr pClipRegion = NullRegion; RegionPtr pClipRegion = NullRegion;
char *data = NULL;
int x, y; int x, y;
int w, h; int w, h;
int length, format;
int saveTrap; int saveTrap;
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentCreateDrawableBitmap: Creating synchronization bitmap for [%s] at [%p].\n", fprintf(stderr, "nxagentCreateDrawableBitmap: Creating synchronization bitmap for drawable at [%p].\n",
nxagentDrawableType(pDrawable), (void *) pDrawable); (void *) pDrawable);
#endif #endif
/* /*
...@@ -2681,7 +2652,23 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable) ...@@ -2681,7 +2652,23 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable)
w = pClipRegion -> extents.x2 - pClipRegion -> extents.x1; w = pClipRegion -> extents.x2 - pClipRegion -> extents.x1;
h = pClipRegion -> extents.y2 - pClipRegion -> extents.y1; 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), REGION_UNION(pDrawable -> pScreen, nxagentCorruptedRegion((DrawablePtr) pBitmap),
nxagentCorruptedRegion((DrawablePtr) pBitmap), pClipRegion); nxagentCorruptedRegion((DrawablePtr) pBitmap), pClipRegion);
...@@ -2724,6 +2711,11 @@ nxagentCreateDrawableBitmapEnd: ...@@ -2724,6 +2711,11 @@ nxagentCreateDrawableBitmapEnd:
nxagentFreeRegion(pDrawable, pClipRegion); nxagentFreeRegion(pDrawable, pClipRegion);
} }
if (data != NULL)
{
xfree(data);
}
if (pGC != NULL) if (pGC != NULL)
{ {
FreeScratchGC(pGC); FreeScratchGC(pGC);
...@@ -3099,16 +3091,6 @@ void nxagentSendBackgroundExpose(WindowPtr pWin, PixmapPtr pBackground, RegionPt ...@@ -3099,16 +3091,6 @@ void nxagentSendBackgroundExpose(WindowPtr pWin, PixmapPtr pBackground, RegionPt
REGION_INTERSECT(pWin -> pScreen, &expose, &expose, &pWin -> clipList); 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); miWindowExposures(pWin, &expose, &expose);
nxagentSendBackgroundExposeEnd: nxagentSendBackgroundExposeEnd:
......
...@@ -63,13 +63,7 @@ ...@@ -63,13 +63,7 @@
#include "NXproto.h" #include "NXproto.h"
#include "xfixesproto.h" #include "xfixesproto.h"
#define Window XlibWindow
#define Atom XlibAtom
#define Time XlibXID
#include <X11/extensions/Xfixes.h> #include <X11/extensions/Xfixes.h>
#undef Window
#undef Atom
#undef Time
#ifdef NXAGENT_FIXKEYS #ifdef NXAGENT_FIXKEYS
#include "inputstr.h" #include "inputstr.h"
...@@ -795,19 +789,13 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) ...@@ -795,19 +789,13 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
} }
x.u.u.type = KeyRelease; x.u.u.type = KeyRelease;
x.u.u.detail = nxagentConvertKeycode(X.xkey.keycode); x.u.u.detail = X.xkey.keycode;
x.u.keyButtonPointer.time = nxagentLastKeyPressTime + x.u.keyButtonPointer.time = nxagentLastKeyPressTime + (X.xkey.time - nxagentLastServerTime);
(X.xkey.time - nxagentLastServerTime);
nxagentLastServerTime = X.xkey.time; nxagentLastServerTime = X.xkey.time;
nxagentLastEventTime = GetTimeInMillis(); nxagentLastEventTime = GetTimeInMillis();
if (x.u.keyButtonPointer.time > nxagentLastEventTime)
{
x.u.keyButtonPointer.time = nxagentLastEventTime;
}
if (!(nxagentCheckSpecialKeystroke(&X.xkey, &result))) if (!(nxagentCheckSpecialKeystroke(&X.xkey, &result)))
{ {
mieqEnqueue(&x); mieqEnqueue(&x);
...@@ -930,7 +918,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) ...@@ -930,7 +918,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
#ifdef NX_DEBUG_INPUT #ifdef NX_DEBUG_INPUT
if (nxagentDebugInput == 1) if (nxagentDebugInput == 1)
{ {
fprintf(stderr, "nxagentDispatchEvents: Going to handle new ButtonRelease event.\n"); fprintf(stderr, "nxagentDispatchEvents: Going to handle new ButtonPress event.\n");
} }
#endif #endif
...@@ -1028,10 +1016,11 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) ...@@ -1028,10 +1016,11 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
nxagentLastEnteredWindow = pWin; nxagentLastEnteredWindow = pWin;
} }
if (nxagentPulldownDialogPid == 0 && nxagentLastEnteredTopLevelWindow && if (nxagentPulldownDialogPid == 0 && (X.xmotion.y_root <
(X.xmotion.y_root < nxagentLastEnteredTopLevelWindow -> drawable.y + 4)) nxagentLastEnteredTopLevelWindow -> drawable.y + 4))
{ {
if (pWin && nxagentClientIsDialog(wClient(pWin)) == 0 && if (pWin && nxagentLastEnteredTopLevelWindow &&
nxagentClientIsDialog(wClient(pWin)) == 0 &&
nxagentLastEnteredTopLevelWindow -> parent == WindowTable[0] && nxagentLastEnteredTopLevelWindow -> parent == WindowTable[0] &&
nxagentLastEnteredTopLevelWindow -> overrideRedirect == False && nxagentLastEnteredTopLevelWindow -> overrideRedirect == False &&
X.xmotion.x_root > (nxagentLastEnteredTopLevelWindow -> drawable.x + X.xmotion.x_root > (nxagentLastEnteredTopLevelWindow -> drawable.x +
...@@ -1063,8 +1052,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) ...@@ -1063,8 +1052,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
#ifdef NX_DEBUG_INPUT #ifdef NX_DEBUG_INPUT
if (nxagentDebugInput == 1) if (nxagentDebugInput == 1)
{ {
fprintf(stderr, "nxagentDispatchEvents: Adding motion event [%d, %d] to the queue.\n", fprintf(stderr, "nxagentDispatchEvents: Adding motion event [%d, %d] to the queue.\n", x.u.keyButtonPointer.rootX, x.u.keyButtonPointer.rootY);
x.u.keyButtonPointer.rootX, x.u.keyButtonPointer.rootY);
} }
#endif #endif
...@@ -1923,9 +1911,8 @@ int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result) ...@@ -1923,9 +1911,8 @@ int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result)
nxagentLastEventTime = nxagentLastKeyPressTime = GetTimeInMillis(); nxagentLastEventTime = nxagentLastKeyPressTime = GetTimeInMillis();
x.u.u.type = KeyPress; 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; x.u.keyButtonPointer.time = nxagentLastKeyPressTime;
nxagentLastServerTime = X -> xkey.time; nxagentLastServerTime = X -> xkey.time;
...@@ -4027,180 +4014,4 @@ void nxagentGuessDumpInputInfo(ClientPtr client, Atom property, char *data) ...@@ -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 #endif
...@@ -65,34 +65,26 @@ is" without express or implied warranty. ...@@ -65,34 +65,26 @@ is" without express or implied warranty.
#define NXAGENT_ALTERNATE_FONT_DIR "/usr/share/X11/fonts" #define NXAGENT_ALTERNATE_FONT_DIR "/usr/share/X11/fonts"
#define NXAGENT_ALTERNATE_FONT_DIR_2 "/usr/share/fonts/X11" #define NXAGENT_ALTERNATE_FONT_DIR_2 "/usr/share/fonts/X11"
#define NXAGENT_ALTERNATE_FONT_DIR_3 "/usr/share/fonts" #define NXAGENT_ALTERNATE_FONT_DIR_3 "/usr/share/fonts"
#define NXAGENT_ALTERNATE_FONT_DIR_4 "/usr/NX/share/fonts"
#define NXAGENT_DEFAULT_FONT_PATH \ #define NXAGENT_DEFAULT_FONT_PATH \
"/usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/X11/fonts/Speedo/,\ "/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/Type1/,/usr/X11R6/lib/X11/fonts/75dpi/,\
/usr/X11R6/lib/X11/fonts/100dpi/,/usr/X11R6/lib/X11/fonts/TTF/,\ /usr/X11R6/lib/X11/fonts/100dpi/,/usr/X11R6/lib/X11/fonts/TTF/"
/usr/NX/share/fonts/base"
#define NXAGENT_ALTERNATE_FONT_PATH \ #define NXAGENT_ALTERNATE_FONT_PATH \
"/usr/share/X11/fonts/misc/,/usr/share/X11/fonts/Speedo/,\ "/usr/share/X11/fonts/misc/,/usr/share/X11/fonts/Speedo/,\
/usr/share/X11/fonts/Type1/,/usr/share/X11/fonts/75dpi/,\ /usr/share/X11/fonts/Type1/,/usr/share/X11/fonts/75dpi/,\
/usr/share/X11/fonts/100dpi/,/usr/share/X11/fonts/TTF/,\ /usr/share/X11/fonts/100dpi/,/usr/share/X11/fonts/TTF/"
/usr/NX/share/fonts/base"
#define NXAGENT_ALTERNATE_FONT_PATH_2 \ #define NXAGENT_ALTERNATE_FONT_PATH_2 \
"/usr/share/fonts/X11/misc/,/usr/share/fonts/X11/Speedo/,\ "/usr/share/fonts/X11/misc/,/usr/share/fonts/X11/Speedo/,\
/usr/share/fonts/X11/Type1/,/usr/share/fonts/X11/75dpi/,\ /usr/share/fonts/X11/Type1/,/usr/share/fonts/X11/75dpi/,\
/usr/share/fonts/X11/100dpi/,/usr/share/fonts/X11/TTF/,\ /usr/share/fonts/X11/100dpi/,/usr/share/fonts/X11/TTF/"
/usr/NX/share/fonts/base"
#define NXAGENT_ALTERNATE_FONT_PATH_3 \ #define NXAGENT_ALTERNATE_FONT_PATH_3 \
"/usr/share/fonts/misc/,/usr/share/fonts/Speedo/,\ "/usr/share/fonts/misc/,/usr/share/fonts/Speedo/,\
/usr/share/fonts/Type1/,/usr/share/fonts/75dpi/,\ /usr/share/fonts/Type1/,/usr/share/fonts/75dpi/,\
/usr/share/fonts/100dpi/,/usr/share/fonts/TTF/,\ /usr/share/fonts/100dpi/,/usr/share/fonts/TTF/"
/usr/NX/share/fonts/base"
#define NXAGENT_ALTERNATE_FONT_PATH_4 \
"/usr/NX/share/fonts/base"
#undef NXAGENT_FONTCACHE_DEBUG #undef NXAGENT_FONTCACHE_DEBUG
#undef NXAGENT_RECONNECT_FONT_DEBUG #undef NXAGENT_RECONNECT_FONT_DEBUG
...@@ -1561,31 +1553,6 @@ void nxagentVerifyDefaultFontPath(void) ...@@ -1561,31 +1553,6 @@ void nxagentVerifyDefaultFontPath(void)
strcat(fontPath, NXAGENT_ALTERNATE_FONT_PATH_3); 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') if (*fontPath == '\0')
{ {
#ifdef WARNING #ifdef WARNING
......
...@@ -594,8 +594,6 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -594,8 +594,6 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
unsigned int format; unsigned int format;
unsigned long planeMask = 0xffffffff; unsigned long planeMask = 0xffffffff;
int oldDstxyValue;
RegionPtr pDstRegion; RegionPtr pDstRegion;
int skip = 0; int skip = 0;
...@@ -607,91 +605,6 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -607,91 +605,6 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
(void *) pDstDrawable, srcx, srcy, dstx, dsty, width, height); (void *) pDstDrawable, srcx, srcy, dstx, dsty, width, height);
#endif #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 (nxagentGCTrap == 1 || nxagentShmTrap == 1)
{ {
if (pSrcDrawable -> type == DRAWABLE_PIXMAP && if (pSrcDrawable -> type == DRAWABLE_PIXMAP &&
......
...@@ -105,13 +105,6 @@ ...@@ -105,13 +105,6 @@
#define MINIMUM_DISPLAY_BUFFER 512 #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 * Used in the handling of the X desktop
* manager protocol. * manager protocol.
...@@ -193,18 +186,6 @@ void nxagentBlockHandler(pointer data, struct timeval **timeout, pointer mask) ...@@ -193,18 +186,6 @@ void nxagentBlockHandler(pointer data, struct timeval **timeout, pointer mask)
now = GetTimeInMillis(); now = GetTimeInMillis();
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInputDevices == 1 &&
now - nxagentLastInputDevicesDumpTime > 5000)
{
nxagentLastInputDevicesDumpTime = now;
nxagentDumpInputDevicesState();
}
#endif
if (nxagentNeedConnectionChange() == 1) if (nxagentNeedConnectionChange() == 1)
{ {
#ifdef TEST #ifdef TEST
...@@ -559,8 +540,6 @@ void nxagentBlockHandler(pointer data, struct timeval **timeout, pointer mask) ...@@ -559,8 +540,6 @@ void nxagentBlockHandler(pointer data, struct timeval **timeout, pointer mask)
#endif #endif
nxagentPrintGeometry();
#ifdef BLOCKS #ifdef BLOCKS
fprintf(stderr, "[End block]\n"); fprintf(stderr, "[End block]\n");
#endif #endif
...@@ -841,8 +820,6 @@ FIXME: Must queue multiple writes and handle ...@@ -841,8 +820,6 @@ FIXME: Must queue multiple writes and handle
#endif #endif
nxagentPrintGeometry();
#ifdef BLOCKS #ifdef BLOCKS
fprintf(stderr, "[End block]\n"); fprintf(stderr, "[End block]\n");
#endif #endif
......
...@@ -75,8 +75,6 @@ is" without express or implied warranty. ...@@ -75,8 +75,6 @@ is" without express or implied warranty.
static int nxagentXkbGetNames(char **rules, char **model, char **layout, static int nxagentXkbGetNames(char **rules, char **model, char **layout,
char **variant, char **options); char **variant, char **options);
static void nxagentKeycodeConversionSetup(void);
#endif /* XKB */ #endif /* XKB */
/* /*
...@@ -191,281 +189,6 @@ unsigned int nxagentAltMetaMask; ...@@ -191,281 +189,6 @@ unsigned int nxagentAltMetaMask;
void nxagentCheckAltMetaKeys(CARD8, int); 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 nxagentSaveKeyboardDeviceData(DeviceIntPtr dev, DeviceIntPtr devBackup);
static int nxagentRestoreKeyboardDeviceData(DeviceIntPtr devBackup, DeviceIntPtr dev); static int nxagentRestoreKeyboardDeviceData(DeviceIntPtr devBackup, DeviceIntPtr dev);
...@@ -675,6 +398,13 @@ int nxagentKeyboardProc(DeviceIntPtr pDev, int onoff) ...@@ -675,6 +398,13 @@ int nxagentKeyboardProc(DeviceIntPtr pDev, int onoff)
int ret; int ret;
char *remoteRules = NULL;
char *remoteModel = NULL;
unsigned int remoteRulesLen;
XkbRF_VarDefsRec remoteDefs;
switch (onoff) switch (onoff)
{ {
case DEVICE_INIT: case DEVICE_INIT:
...@@ -946,21 +676,14 @@ XkbError: ...@@ -946,21 +676,14 @@ XkbError:
xkb = XkbGetKeyboard(nxagentDisplay, XkbGBN_AllComponentsMask, XkbUseCoreKbd); xkb = XkbGetKeyboard(nxagentDisplay, XkbGBN_AllComponentsMask, XkbUseCoreKbd);
nxagentKeycodeConversionSetup();
if (xkb == NULL || xkb->geom == NULL) if (xkb == NULL || xkb->geom == NULL)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentKeyboardProc: No current keyboard.\n"); fprintf(stderr, "nxagentKeyboardProc: No current keyboard.\n");
if (xkb == NULL) #endif
{
fprintf(stderr, "nxagentKeyboardProc: xkb is null.\n"); #ifdef TEST
} fprintf(stderr, "nxagentKeyboardProc: No keyboard, going to set rules and init device.\n");
else
{
fprintf(stderr, "nxagentKeyboardProc: xkb->geom is null.\n");
}
fprintf(stderr, "nxagentKeyboardProc: Going to set rules and init device.\n");
#endif #endif
XkbSetRulesDflts(rules, model, layout, variants, options); XkbSetRulesDflts(rules, model, layout, variants, options);
...@@ -976,6 +699,40 @@ XkbError: ...@@ -976,6 +699,40 @@ XkbError:
goto XkbEnd; 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); XkbGetControls(nxagentDisplay, XkbAllControlsMask, xkb);
nxagentXkbConfigFilePathSize = strlen(XkbBaseDirectory) + nxagentXkbConfigFilePathSize = strlen(XkbBaseDirectory) +
...@@ -1056,6 +813,66 @@ XkbError: ...@@ -1056,6 +813,66 @@ XkbError:
free(nxagentXkbConfigFilePath); 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 || if (!nxagentKeyboard ||
(nxagentKeyboard && (strcmp(nxagentKeyboard, "query") == 0))) (nxagentKeyboard && (strcmp(nxagentKeyboard, "query") == 0)))
{ {
...@@ -1745,70 +1562,4 @@ static int nxagentXkbGetNames(char **rules, char **model, char **layout, ...@@ -1745,70 +1562,4 @@ static int nxagentXkbGetNames(char **rules, char **model, char **layout,
return n; 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 #endif
...@@ -109,10 +109,6 @@ void nxagentEnableXkbExtension(void); ...@@ -109,10 +109,6 @@ void nxagentEnableXkbExtension(void);
void nxagentTuneXkbWrapper(void); void nxagentTuneXkbWrapper(void);
void nxagentResetKeycodeConversion(void);
#endif #endif
CARD8 nxagentConvertKeycode(CARD8 k);
#endif /* __Keyboard_H__ */ #endif /* __Keyboard_H__ */
...@@ -31,12 +31,6 @@ ...@@ -31,12 +31,6 @@
extern Bool nxagentWMIsRunning; extern Bool nxagentWMIsRunning;
extern Bool nxagentIpaq; extern Bool nxagentIpaq;
#ifdef NX_DEBUG_INPUT
int nxagentDebugInputDevices = 0;
unsigned long nxagentLastInputDevicesDumpTime = 0;
extern void nxagentDeactivateInputDevicesGrabs();
#endif
/* /*
* Set here the required log level. * Set here the required log level.
*/ */
...@@ -215,53 +209,6 @@ int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) ...@@ -215,53 +209,6 @@ int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
} }
#endif #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
} }
} }
......
...@@ -39,11 +39,6 @@ AgentOptionsRec nxagentOptionsBackup; ...@@ -39,11 +39,6 @@ AgentOptionsRec nxagentOptionsBackup;
AgentOptionsPtr nxagentOptionsPtr = &nxagentOptions; 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 * This must be called at startup to initialize
* the options repository to the default values. * the options repository to the default values.
*/ */
......
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
#define UNDEFINED -1 #define UNDEFINED -1
#define COPY_UNLIMITED -1 #define COPY_UNLIMITED -1
extern unsigned int nxagentPrintGeometryFlags;
typedef enum _BackingStoreMode typedef enum _BackingStoreMode
{ {
BackingStoreUndefined = -1, BackingStoreUndefined = -1,
......
...@@ -257,11 +257,7 @@ TODO: This should be reset only when ...@@ -257,11 +257,7 @@ TODO: This should be reset only when
if ((dispatchException & DE_TERMINATE) == 0) 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()); fprintf(stderr, "Session: Session suspended at '%s'.\n", GetTimeAsString());
#endif
} }
nxagentResetDisplayHandlers(); nxagentResetDisplayHandlers();
...@@ -551,11 +547,13 @@ Bool nxagentReconnectSession(void) ...@@ -551,11 +547,13 @@ Bool nxagentReconnectSession(void)
goto nxagentReconnectError; goto nxagentReconnectError;
} }
if (nxagentOption(ResetKeyboardAtResume) == 1 && if (nxagentOption(ResetKeyboardAtResume))
(nxagentKeyboard == NULL || nxagentOldKeyboard == NULL || {
if (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL ||
strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 || strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 ||
strcmp(nxagentKeyboard, "query") == 0)) strcmp(nxagentKeyboard, "query") == 0)
{ {
if (nxagentResetKeyboard() == 0) if (nxagentResetKeyboard() == 0)
{ {
#ifdef WARNING #ifdef WARNING
...@@ -570,9 +568,6 @@ Bool nxagentReconnectSession(void) ...@@ -570,9 +568,6 @@ Bool nxagentReconnectSession(void)
goto nxagentReconnectError; goto nxagentReconnectError;
} }
} }
else
{
nxagentResetKeycodeConversion();
} }
nxagentXkbState.Initialized = 0; nxagentXkbState.Initialized = 0;
...@@ -613,11 +608,7 @@ Bool nxagentReconnectSession(void) ...@@ -613,11 +608,7 @@ Bool nxagentReconnectSession(void)
goto nxagentReconnectError; 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()); fprintf(stderr, "Session: Session resumed at '%s'.\n", GetTimeAsString());
#endif
nxagentRemoveSplashWindow(NULL); nxagentRemoveSplashWindow(NULL);
......
...@@ -2270,7 +2270,8 @@ void nxagentAddGlyphs(GlyphSetPtr glyphSet, Glyph *gids, xGlyphInfo *gi, ...@@ -2270,7 +2270,8 @@ void nxagentAddGlyphs(GlyphSetPtr glyphSet, Glyph *gids, xGlyphInfo *gi,
normalizedImages = NULL; normalizedImages = NULL;
if (sizeImages > 0) if (glyphDepths[glyphSet -> fdepth] == 1 &&
nxagentServerOrder() != BitmapBitOrder(nxagentDisplay))
{ {
normalizedImages = xalloc(sizeImages); normalizedImages = xalloc(sizeImages);
...@@ -2278,12 +2279,8 @@ void nxagentAddGlyphs(GlyphSetPtr glyphSet, Glyph *gids, xGlyphInfo *gi, ...@@ -2278,12 +2279,8 @@ void nxagentAddGlyphs(GlyphSetPtr glyphSet, Glyph *gids, xGlyphInfo *gi,
{ {
memcpy(normalizedImages, images, sizeImages); memcpy(normalizedImages, images, sizeImages);
if (glyphDepths[glyphSet -> fdepth] == 1 &&
nxagentServerOrder() != BitmapBitOrder(nxagentDisplay))
{
BitOrderInvert ((unsigned char *) normalizedImages, sizeImages); BitOrderInvert ((unsigned char *) normalizedImages, sizeImages);
} }
}
else else
{ {
#ifdef PANIC #ifdef PANIC
......
...@@ -60,27 +60,6 @@ typedef struct ...@@ -60,27 +60,6 @@ typedef struct
} }
nxagentWMHints; 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; WindowPtr nxagentRootlessWindow = NULL;
#define TOP_LEVEL_TABLE_UNIT 100 #define TOP_LEVEL_TABLE_UNIT 100
...@@ -450,7 +429,6 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -450,7 +429,6 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
Atom propertyX, typeX; Atom propertyX, typeX;
char *output = NULL; char *output = NULL;
nxagentWMHints wmHints; nxagentWMHints wmHints;
nxagentPropWMHints propHints;
Bool export = False; Bool export = False;
Bool freeMem = False; Bool freeMem = False;
...@@ -511,21 +489,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -511,21 +489,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
wmHints.flags |= InputHint; wmHints.flags |= InputHint;
wmHints.input = True; wmHints.input = True;
/* output = (char*) &wmHints;
* 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; export = True;
if ((wmHints.flags & IconPixmapHint) && (wmHints.icon_pixmap != None)) if ((wmHints.flags & IconPixmapHint) && (wmHints.icon_pixmap != None))
...@@ -540,17 +504,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -540,17 +504,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
nxagentSynchronizeRegion((DrawablePtr) icon, NullRegion, NEVER_BREAK, NULL); nxagentSynchronizeRegion((DrawablePtr) icon, NullRegion, NEVER_BREAK, NULL);
} }
propHints.iconPixmap = nxagentPixmap(icon); wmHints.icon_pixmap = nxagentPixmap(icon);
} }
else else
{ {
propHints.flags &= ~IconPixmapHint; wmHints.flags &= ~IconPixmapHint;
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon pixmap %x from hint " fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon pixmap %x from hint "
"exporting property %s type %s on window %p.\n", "exporting property %s type %s on window %p.\n",
(unsigned int) wmHints.icon_pixmap, propertyS, typeS, (unsigned int) wmHints.icon_pixmap, propertyS, typeS,
(void *) pWin); (void*)pWin);
#endif #endif
} }
} }
...@@ -562,17 +526,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -562,17 +526,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
if (icon) if (icon)
{ {
propHints.iconWindow = nxagentWindow(icon); wmHints.icon_window = nxagentWindow(icon);
} }
else else
{ {
propHints.flags &= ~IconWindowHint; wmHints.flags &= ~IconWindowHint;
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon window %x from hint " fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon window %x from hint "
"exporting property %s type %s on window %p.\n", "exporting property %s type %s on window %p.\n",
(unsigned int) wmHints.icon_window, propertyS, typeS, (unsigned int) wmHints.icon_window, propertyS, typeS,
(void *) pWin); (void*)pWin);
#endif #endif
} }
} }
...@@ -584,17 +548,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -584,17 +548,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
if (icon) if (icon)
{ {
propHints.iconMask = nxagentPixmap(icon); wmHints.icon_mask = nxagentPixmap(icon);
} }
else else
{ {
propHints.flags &= ~IconMaskHint; wmHints.flags &= ~IconMaskHint;
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon mask %x from hint " fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon mask %x from hint "
"exporting property %s type %s on window %p.\n", "exporting property %s type %s on window %p.\n",
(unsigned int) wmHints.icon_mask, propertyS, typeS, (unsigned int) wmHints.icon_mask, propertyS, typeS,
(void *) pWin); (void*)pWin);
#endif #endif
} }
} }
...@@ -606,17 +570,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -606,17 +570,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
if (window) if (window)
{ {
propHints.windowGroup = nxagentWindow(window); wmHints.window_group = nxagentWindow(window);
} }
else else
{ {
propHints.flags &= ~WindowGroupHint; wmHints.flags &= ~WindowGroupHint;
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up window group %x from hint " fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up window group %x from hint "
"exporting property %s type %s on window %p.\n", "exporting property %s type %s on window %p.\n",
(unsigned int) wmHints.window_group, propertyS, typeS, (unsigned int) wmHints.window_group, propertyS, typeS,
(void *) pWin); (void*)pWin);
#endif #endif
} }
} }
......
...@@ -2373,7 +2373,8 @@ FIXME: We should try to restore the previously ...@@ -2373,7 +2373,8 @@ FIXME: We should try to restore the previously
nxagentPrintAgentGeometry("After Resize Screen", "nxagentResizeScreen:"); nxagentPrintAgentGeometry("After Resize Screen", "nxagentResizeScreen:");
#endif #endif
nxagentSetPrintGeometry(pScreen -> myNum); fprintf(stderr, "Info: Screen [%d] resized to geometry [%dx%d].\n",
pScreen -> myNum, width, height);
return 1; return 1;
...@@ -3693,8 +3694,7 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg, ...@@ -3693,8 +3694,7 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg,
return; return;
} }
void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, int yorg, WindowPtr pWin)
int yorg, WindowPtr pWin)
{ {
PixmapPtr pVirtualPixmap; PixmapPtr pVirtualPixmap;
RegionPtr clipRegion; RegionPtr clipRegion;
...@@ -3710,14 +3710,6 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, ...@@ -3710,14 +3710,6 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg,
BoxRec extents; BoxRec extents;
miBSWindowPtr pBackingStore; 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; pBackingStore = (miBSWindowPtr) pWin -> backStorage;
pVirtualPixmap = nxagentVirtualPixmap(pPixmap); pVirtualPixmap = nxagentVirtualPixmap(pPixmap);
...@@ -3911,24 +3903,6 @@ void nxagentShadowAdaptToRatio(void) ...@@ -3911,24 +3903,6 @@ void nxagentShadowAdaptToRatio(void)
REGION_UNINIT(pScreen, &region); REGION_UNINIT(pScreen, &region);
} }
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 #ifdef DUMP
void nxagentShowPixmap(PixmapPtr pPixmap, int x, int y, int width, int height) void nxagentShowPixmap(PixmapPtr pPixmap, int x, int y, int width, int height)
......
...@@ -36,9 +36,6 @@ is" without express or implied warranty. ...@@ -36,9 +36,6 @@ is" without express or implied warranty.
#define MIN_NXAGENT_HEIGHT 60 #define MIN_NXAGENT_HEIGHT 60
#define NXAGENT_FRAME_WIDTH 2000 #define NXAGENT_FRAME_WIDTH 2000
#define nxagentSetPrintGeometry(screen) \
nxagentPrintGeometryFlags = (1 << (screen));
extern int nxagentClients; extern int nxagentClients;
extern int nxagentAutoDisconnectTimeout; extern int nxagentAutoDisconnectTimeout;
......
...@@ -908,8 +908,6 @@ void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn) ...@@ -908,8 +908,6 @@ void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn)
XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0,
nxagentOption(Width), nxagentOption(Height)); nxagentOption(Width), nxagentOption(Height));
nxagentSetPrintGeometry(pScreen -> myNum);
} }
#ifdef VIEWPORT_FRAME #ifdef VIEWPORT_FRAME
......
...@@ -515,11 +515,7 @@ Dispatch(void) ...@@ -515,11 +515,7 @@ Dispatch(void)
if (serverGeneration > nxagentMaxAllowedResets) 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()); fprintf(stderr, "Session: Session started at '%s'.\n", GetTimeAsString());
#endif
nxagentSessionState = SESSION_UP; nxagentSessionState = SESSION_UP;
} }
......
...@@ -515,11 +515,7 @@ Dispatch(void) ...@@ -515,11 +515,7 @@ Dispatch(void)
if (serverGeneration > nxagentMaxAllowedResets) 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()); fprintf(stderr, "Session: Session started at '%s'.\n", GetTimeAsString());
#endif
nxagentSessionState = SESSION_UP; nxagentSessionState = SESSION_UP;
} }
......
...@@ -189,11 +189,6 @@ xEvent *xeviexE; ...@@ -189,11 +189,6 @@ xEvent *xeviexE;
#include "Windows.h" #include "Windows.h"
#include "Args.h" #include "Args.h"
#ifdef NX_DEBUG_INPUT
extern int nxagentDebugInput;
extern int nxagentDebugInputDevices;
#endif
extern Display *nxagentDisplay; extern Display *nxagentDisplay;
extern WindowPtr nxagentLastEnteredWindow; extern WindowPtr nxagentLastEnteredWindow;
...@@ -1687,28 +1682,11 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, ...@@ -1687,28 +1682,11 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask,
int i; int i;
int type; int type;
#ifdef NX_DEBUG_INPUT #ifdef DEBUG
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
if (debug_events) ErrorF( if (debug_events) ErrorF(
"Event([%d, %d], mask=0x%x), client=%d", "Event([%d, %d], mask=0x%x), client=%d",
pEvents->u.u.type, pEvents->u.u.detail, mask, client->index); pEvents->u.u.type, pEvents->u.u.detail, mask, client->index);
#endif #endif
#endif
if ((client) && (client != serverClient) && (!client->clientGone) && if ((client) && (client != serverClient) && (!client->clientGone) &&
((filter == CantBeFiltered) || (mask & filter))) ((filter == CantBeFiltered) || (mask & filter)))
{ {
...@@ -1722,17 +1700,10 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, ...@@ -1722,17 +1700,10 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask,
if (WID(inputInfo.pointer->valuator->motionHintWindow) == if (WID(inputInfo.pointer->valuator->motionHintWindow) ==
pEvents->u.keyButtonPointer.event) pEvents->u.keyButtonPointer.event)
{ {
#if defined(DEBUG) || defined(NX_DEBUG_INPUT) #ifdef DEBUG
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInput == 1)
{
fprintf(stderr,"\nmotionHintWindow == keyButtonPointer.event\n");
}
#else
if (debug_events) ErrorF("\n"); if (debug_events) ErrorF("\n");
fprintf(stderr,"motionHintWindow == keyButtonPointer.event\n"); fprintf(stderr,"motionHintWindow == keyButtonPointer.event\n");
#endif #endif
#endif
return 1; /* don't send, but pretend we did */ return 1; /* don't send, but pretend we did */
} }
pEvents->u.u.detail = NotifyHint; pEvents->u.u.detail = NotifyHint;
...@@ -1769,26 +1740,16 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, ...@@ -1769,26 +1740,16 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask,
} }
WriteEventsToClient(client, count, pEvents); WriteEventsToClient(client, count, pEvents);
#if defined(DEBUG) || defined(NX_DEBUG_INPUT) #ifdef DEBUG
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInput == 1)
fprintf(stderr, " delivered\n");
#else
if (debug_events) ErrorF( " delivered\n"); if (debug_events) ErrorF( " delivered\n");
#endif #endif
#endif
return 1; return 1;
} }
else else
{ {
#if defined(DEBUG) || defined(NX_DEBUG_INPUT) #ifdef DEBUG
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInput == 1)
fprintf(stderr, "\n");
#else
if (debug_events) ErrorF("\n"); if (debug_events) ErrorF("\n");
#endif #endif
#endif
return 0; return 0;
} }
} }
...@@ -1866,12 +1827,6 @@ DeliverEventsToWindow(register WindowPtr pWin, xEvent *pEvents, int count, ...@@ -1866,12 +1827,6 @@ DeliverEventsToWindow(register WindowPtr pWin, xEvent *pEvents, int count,
tempGrab.pointerMode = GrabModeAsync; tempGrab.pointerMode = GrabModeAsync;
tempGrab.confineTo = NullWindow; tempGrab.confineTo = NullWindow;
tempGrab.cursor = NullCursor; 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, (*inputInfo.pointer->ActivateGrab)(inputInfo.pointer, &tempGrab,
currentTime, TRUE); currentTime, TRUE);
} }
...@@ -2742,13 +2697,6 @@ CheckPassiveGrabsOnWindow( ...@@ -2742,13 +2697,6 @@ CheckPassiveGrabsOnWindow(
tempGrab.modifiersDetail.exact&(~0x1f00); tempGrab.modifiersDetail.exact&(~0x1f00);
} }
#endif #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); (*device->ActivateGrab)(device, grab, currentTime, TRUE);
FixUpEventFromWindow(xE, grab->window, None, TRUE); FixUpEventFromWindow(xE, grab->window, None, TRUE);
...@@ -3107,17 +3055,7 @@ drawable.id:0; ...@@ -3107,17 +3055,7 @@ drawable.id:0;
else else
DeliverFocusedEvent(keybd, xE, sprite.win, count); DeliverFocusedEvent(keybd, xE, sprite.win, count);
if (deactivateGrab) if (deactivateGrab)
#ifdef NX_DEBUG_INPUT
{
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcessKeyboardEvent: Deactivating grab on keyboard.\n");
}
#endif
(*keybd->DeactivateGrab)(keybd); (*keybd->DeactivateGrab)(keybd);
#ifdef NX_DEBUG_INPUT
}
#endif
} }
#ifdef XKB #ifdef XKB
...@@ -3178,12 +3116,6 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count ...@@ -3178,12 +3116,6 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count
xevieEventSent = 0; xevieEventSent = 0;
else { else {
xeviemouse = mouse; 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); WriteToClient(clients[xevieClientIndex], sizeof(xEvent), (char *)xE);
return; return;
} }
...@@ -3238,38 +3170,14 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count ...@@ -3238,38 +3170,14 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count
#if !defined(XFree86Server) || !defined(XINPUT) #if !defined(XFree86Server) || !defined(XINPUT)
xE->u.u.detail = butc->map[key]; xE->u.u.detail = butc->map[key];
#endif #endif
#ifdef NX_DEBUG_INPUT
if (xE->u.u.detail == 0) if (xE->u.u.detail == 0)
{
if (nxagentDebugInput == 1)
{
fprintf(stderr, "ProcessPointerEvent: WARNING! detail == 0"
" for ButtonPress.\n");
}
return; return;
}
#else
if (xE->u.u.detail == 0)
return;
#endif
if (xE->u.u.detail <= 5) if (xE->u.u.detail <= 5)
butc->state |= (Button1Mask >> 1) << xE->u.u.detail; butc->state |= (Button1Mask >> 1) << xE->u.u.detail;
filters[MotionNotify] = Motion_Filter(butc); filters[MotionNotify] = Motion_Filter(butc);
if (!grab) 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)) if (CheckDeviceGrabs(mouse, xE, 0, count))
return; return;
#endif
break; break;
case ButtonRelease: case ButtonRelease:
mouse->valuator->motionHintWindow = NullWindow; mouse->valuator->motionHintWindow = NullWindow;
...@@ -3281,20 +3189,8 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count ...@@ -3281,20 +3189,8 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count
#if !defined(XFree86Server) || !defined(XINPUT) #if !defined(XFree86Server) || !defined(XINPUT)
xE->u.u.detail = butc->map[key]; xE->u.u.detail = butc->map[key];
#endif #endif
#ifdef NX_DEBUG_INPUT
if (xE->u.u.detail == 0) if (xE->u.u.detail == 0)
{
if (nxagentDebugInput == 1)
{
fprintf(stderr, "ProcessPointerEvent: WARNING! detail == 0"
" for ButtonRelease.\n");
}
return; return;
}
#else
if (xE->u.u.detail == 0)
return;
#endif
if (xE->u.u.detail <= 5) if (xE->u.u.detail <= 5)
butc->state &= ~((Button1Mask >> 1) << xE->u.u.detail); butc->state &= ~((Button1Mask >> 1) << xE->u.u.detail);
filters[MotionNotify] = Motion_Filter(butc); filters[MotionNotify] = Motion_Filter(butc);
...@@ -3305,36 +3201,6 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count ...@@ -3305,36 +3201,6 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count
FatalError("bogus pointer event from ddx"); 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)) else if (!CheckMotion(xE))
return; return;
if (grab) if (grab)
...@@ -3342,19 +3208,8 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count ...@@ -3342,19 +3208,8 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count
else else
DeliverDeviceEvents(sprite.win, xE, NullGrab, NullWindow, DeliverDeviceEvents(sprite.win, xE, NullGrab, NullWindow,
mouse, count); mouse, count);
#endif
if (deactivateGrab) if (deactivateGrab)
#ifdef NX_DEBUG_INPUT
{
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcessPointerEvent: Deactivating grab on pointer.\n");
}
#endif
(*mouse->DeactivateGrab)(mouse); (*mouse->DeactivateGrab)(mouse);
#ifdef NX_DEBUG_INPUT
}
#endif
} }
#define AtMostOneClient \ #define AtMostOneClient \
...@@ -4075,12 +3930,6 @@ ProcGrabPointer(ClientPtr client) ...@@ -4075,12 +3930,6 @@ ProcGrabPointer(ClientPtr client)
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess);
if (!pWin) if (!pWin)
return BadWindow; 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) if (stuff->confineTo == None)
confineTo = NullWindow; confineTo = NullWindow;
else else
...@@ -4140,12 +3989,6 @@ ProcGrabPointer(ClientPtr client) ...@@ -4140,12 +3989,6 @@ ProcGrabPointer(ClientPtr client)
tempGrab.keyboardMode = stuff->keyboardMode; tempGrab.keyboardMode = stuff->keyboardMode;
tempGrab.pointerMode = stuff->pointerMode; tempGrab.pointerMode = stuff->pointerMode;
tempGrab.device = device; 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); (*device->ActivateGrab)(device, &tempGrab, time, FALSE);
if (oldCursor) if (oldCursor)
FreeCursor (oldCursor, (Cursor)0); FreeCursor (oldCursor, (Cursor)0);
...@@ -4209,12 +4052,6 @@ ProcUngrabPointer(ClientPtr client) ...@@ -4209,12 +4052,6 @@ ProcUngrabPointer(ClientPtr client)
TimeStamp time; TimeStamp time;
REQUEST(xResourceReq); REQUEST(xResourceReq);
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcUngrabPointer: client [%d].\n", client -> index);
}
#endif
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
UpdateCurrentTime(); UpdateCurrentTime();
grab = device->grab; grab = device->grab;
...@@ -4222,25 +4059,7 @@ ProcUngrabPointer(ClientPtr client) ...@@ -4222,25 +4059,7 @@ ProcUngrabPointer(ClientPtr client)
if ((CompareTimeStamps(time, currentTime) != LATER) && if ((CompareTimeStamps(time, currentTime) != LATER) &&
(CompareTimeStamps(time, device->grabTime) != EARLIER) && (CompareTimeStamps(time, device->grabTime) != EARLIER) &&
(grab) && SameClient(grab, client)) (grab) && SameClient(grab, client))
#ifdef NX_DEBUG_INPUT
{
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcUngrabPointer: Deactivating grab on pointer.\n");
}
#endif
(*device->DeactivateGrab)(device); (*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; return Success;
} }
...@@ -4295,12 +4114,6 @@ GrabDevice(register ClientPtr client, register DeviceIntPtr dev, ...@@ -4295,12 +4114,6 @@ GrabDevice(register ClientPtr client, register DeviceIntPtr dev,
tempGrab.pointerMode = other_mode; tempGrab.pointerMode = other_mode;
tempGrab.eventMask = mask; tempGrab.eventMask = mask;
tempGrab.device = dev; 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); (*dev->ActivateGrab)(dev, &tempGrab, time, FALSE);
*status = GrabSuccess; *status = GrabSuccess;
} }
...@@ -4314,12 +4127,6 @@ ProcGrabKeyboard(ClientPtr client) ...@@ -4314,12 +4127,6 @@ ProcGrabKeyboard(ClientPtr client)
REQUEST(xGrabKeyboardReq); REQUEST(xGrabKeyboardReq);
int result; int result;
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcGrabKeyboard: client [%d].\n", client -> index);
}
#endif
REQUEST_SIZE_MATCH(xGrabKeyboardReq); REQUEST_SIZE_MATCH(xGrabKeyboardReq);
#ifdef XCSECURITY #ifdef XCSECURITY
if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard, TRUE)) if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard, TRUE))
...@@ -4350,12 +4157,6 @@ ProcUngrabKeyboard(ClientPtr client) ...@@ -4350,12 +4157,6 @@ ProcUngrabKeyboard(ClientPtr client)
TimeStamp time; TimeStamp time;
REQUEST(xResourceReq); REQUEST(xResourceReq);
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcUngrabKeyboard: client [%d].\n", client -> index);
}
#endif
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
UpdateCurrentTime(); UpdateCurrentTime();
grab = device->grab; grab = device->grab;
...@@ -4363,25 +4164,7 @@ ProcUngrabKeyboard(ClientPtr client) ...@@ -4363,25 +4164,7 @@ ProcUngrabKeyboard(ClientPtr client)
if ((CompareTimeStamps(time, currentTime) != LATER) && if ((CompareTimeStamps(time, currentTime) != LATER) &&
(CompareTimeStamps(time, device->grabTime) != EARLIER) && (CompareTimeStamps(time, device->grabTime) != EARLIER) &&
(grab) && SameClient(grab, client)) (grab) && SameClient(grab, client))
#ifdef NX_DEBUG_INPUT
{
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcUngrabKeyboard: Deactivating grab on keyboard.\n");
}
#endif
(*device->DeactivateGrab)(device); (*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; return Success;
} }
......
...@@ -189,11 +189,6 @@ xEvent *xeviexE; ...@@ -189,11 +189,6 @@ xEvent *xeviexE;
#include "Windows.h" #include "Windows.h"
#include "Args.h" #include "Args.h"
#ifdef NX_DEBUG_INPUT
extern int nxagentDebugInput;
extern int nxagentDebugInputDevices;
#endif
extern Display *nxagentDisplay; extern Display *nxagentDisplay;
extern WindowPtr nxagentLastEnteredWindow; extern WindowPtr nxagentLastEnteredWindow;
...@@ -1687,28 +1682,11 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, ...@@ -1687,28 +1682,11 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask,
int i; int i;
int type; int type;
#ifdef NX_DEBUG_INPUT #ifdef DEBUG
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
if (debug_events) ErrorF( if (debug_events) ErrorF(
"Event([%d, %d], mask=0x%x), client=%d", "Event([%d, %d], mask=0x%x), client=%d",
pEvents->u.u.type, pEvents->u.u.detail, mask, client->index); pEvents->u.u.type, pEvents->u.u.detail, mask, client->index);
#endif #endif
#endif
if ((client) && (client != serverClient) && (!client->clientGone) && if ((client) && (client != serverClient) && (!client->clientGone) &&
((filter == CantBeFiltered) || (mask & filter))) ((filter == CantBeFiltered) || (mask & filter)))
{ {
...@@ -1722,17 +1700,10 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, ...@@ -1722,17 +1700,10 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask,
if (WID(inputInfo.pointer->valuator->motionHintWindow) == if (WID(inputInfo.pointer->valuator->motionHintWindow) ==
pEvents->u.keyButtonPointer.event) pEvents->u.keyButtonPointer.event)
{ {
#if defined(DEBUG) || defined(NX_DEBUG_INPUT) #ifdef DEBUG
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInput == 1)
{
fprintf(stderr,"\nmotionHintWindow == keyButtonPointer.event\n");
}
#else
if (debug_events) ErrorF("\n"); if (debug_events) ErrorF("\n");
fprintf(stderr,"motionHintWindow == keyButtonPointer.event\n"); fprintf(stderr,"motionHintWindow == keyButtonPointer.event\n");
#endif #endif
#endif
return 1; /* don't send, but pretend we did */ return 1; /* don't send, but pretend we did */
} }
pEvents->u.u.detail = NotifyHint; pEvents->u.u.detail = NotifyHint;
...@@ -1769,26 +1740,16 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, ...@@ -1769,26 +1740,16 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask,
} }
WriteEventsToClient(client, count, pEvents); WriteEventsToClient(client, count, pEvents);
#if defined(DEBUG) || defined(NX_DEBUG_INPUT) #ifdef DEBUG
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInput == 1)
fprintf(stderr, " delivered\n");
#else
if (debug_events) ErrorF( " delivered\n"); if (debug_events) ErrorF( " delivered\n");
#endif #endif
#endif
return 1; return 1;
} }
else else
{ {
#if defined(DEBUG) || defined(NX_DEBUG_INPUT) #ifdef DEBUG
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInput == 1)
fprintf(stderr, "\n");
#else
if (debug_events) ErrorF("\n"); if (debug_events) ErrorF("\n");
#endif #endif
#endif
return 0; return 0;
} }
} }
...@@ -1866,12 +1827,6 @@ DeliverEventsToWindow(register WindowPtr pWin, xEvent *pEvents, int count, ...@@ -1866,12 +1827,6 @@ DeliverEventsToWindow(register WindowPtr pWin, xEvent *pEvents, int count,
tempGrab.pointerMode = GrabModeAsync; tempGrab.pointerMode = GrabModeAsync;
tempGrab.confineTo = NullWindow; tempGrab.confineTo = NullWindow;
tempGrab.cursor = NullCursor; 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, (*inputInfo.pointer->ActivateGrab)(inputInfo.pointer, &tempGrab,
currentTime, TRUE); currentTime, TRUE);
} }
...@@ -2742,13 +2697,6 @@ CheckPassiveGrabsOnWindow( ...@@ -2742,13 +2697,6 @@ CheckPassiveGrabsOnWindow(
tempGrab.modifiersDetail.exact&(~0x1f00); tempGrab.modifiersDetail.exact&(~0x1f00);
} }
#endif #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); (*device->ActivateGrab)(device, grab, currentTime, TRUE);
FixUpEventFromWindow(xE, grab->window, None, TRUE); FixUpEventFromWindow(xE, grab->window, None, TRUE);
...@@ -3107,17 +3055,7 @@ drawable.id:0; ...@@ -3107,17 +3055,7 @@ drawable.id:0;
else else
DeliverFocusedEvent(keybd, xE, sprite.win, count); DeliverFocusedEvent(keybd, xE, sprite.win, count);
if (deactivateGrab) if (deactivateGrab)
#ifdef NX_DEBUG_INPUT
{
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcessKeyboardEvent: Deactivating grab on keyboard.\n");
}
#endif
(*keybd->DeactivateGrab)(keybd); (*keybd->DeactivateGrab)(keybd);
#ifdef NX_DEBUG_INPUT
}
#endif
} }
#ifdef XKB #ifdef XKB
...@@ -3178,12 +3116,6 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count ...@@ -3178,12 +3116,6 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count
xevieEventSent = 0; xevieEventSent = 0;
else { else {
xeviemouse = mouse; 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); WriteToClient(clients[xevieClientIndex], sizeof(xEvent), (char *)xE);
return; return;
} }
...@@ -3238,38 +3170,14 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count ...@@ -3238,38 +3170,14 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count
#if !defined(XFree86Server) || !defined(XINPUT) #if !defined(XFree86Server) || !defined(XINPUT)
xE->u.u.detail = butc->map[key]; xE->u.u.detail = butc->map[key];
#endif #endif
#ifdef NX_DEBUG_INPUT
if (xE->u.u.detail == 0) if (xE->u.u.detail == 0)
{
if (nxagentDebugInput == 1)
{
fprintf(stderr, "ProcessPointerEvent: WARNING! detail == 0"
" for ButtonPress.\n");
}
return; return;
}
#else
if (xE->u.u.detail == 0)
return;
#endif
if (xE->u.u.detail <= 5) if (xE->u.u.detail <= 5)
butc->state |= (Button1Mask >> 1) << xE->u.u.detail; butc->state |= (Button1Mask >> 1) << xE->u.u.detail;
filters[MotionNotify] = Motion_Filter(butc); filters[MotionNotify] = Motion_Filter(butc);
if (!grab) 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)) if (CheckDeviceGrabs(mouse, xE, 0, count))
return; return;
#endif
break; break;
case ButtonRelease: case ButtonRelease:
mouse->valuator->motionHintWindow = NullWindow; mouse->valuator->motionHintWindow = NullWindow;
...@@ -3281,20 +3189,8 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count ...@@ -3281,20 +3189,8 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count
#if !defined(XFree86Server) || !defined(XINPUT) #if !defined(XFree86Server) || !defined(XINPUT)
xE->u.u.detail = butc->map[key]; xE->u.u.detail = butc->map[key];
#endif #endif
#ifdef NX_DEBUG_INPUT
if (xE->u.u.detail == 0) if (xE->u.u.detail == 0)
{
if (nxagentDebugInput == 1)
{
fprintf(stderr, "ProcessPointerEvent: WARNING! detail == 0"
" for ButtonRelease.\n");
}
return; return;
}
#else
if (xE->u.u.detail == 0)
return;
#endif
if (xE->u.u.detail <= 5) if (xE->u.u.detail <= 5)
butc->state &= ~((Button1Mask >> 1) << xE->u.u.detail); butc->state &= ~((Button1Mask >> 1) << xE->u.u.detail);
filters[MotionNotify] = Motion_Filter(butc); filters[MotionNotify] = Motion_Filter(butc);
...@@ -3305,36 +3201,6 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count ...@@ -3305,36 +3201,6 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count
FatalError("bogus pointer event from ddx"); 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)) else if (!CheckMotion(xE))
return; return;
if (grab) if (grab)
...@@ -3342,19 +3208,8 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count ...@@ -3342,19 +3208,8 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count
else else
DeliverDeviceEvents(sprite.win, xE, NullGrab, NullWindow, DeliverDeviceEvents(sprite.win, xE, NullGrab, NullWindow,
mouse, count); mouse, count);
#endif
if (deactivateGrab) if (deactivateGrab)
#ifdef NX_DEBUG_INPUT
{
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcessPointerEvent: Deactivating grab on pointer.\n");
}
#endif
(*mouse->DeactivateGrab)(mouse); (*mouse->DeactivateGrab)(mouse);
#ifdef NX_DEBUG_INPUT
}
#endif
} }
#define AtMostOneClient \ #define AtMostOneClient \
...@@ -4075,12 +3930,6 @@ ProcGrabPointer(ClientPtr client) ...@@ -4075,12 +3930,6 @@ ProcGrabPointer(ClientPtr client)
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess);
if (!pWin) if (!pWin)
return BadWindow; 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) if (stuff->confineTo == None)
confineTo = NullWindow; confineTo = NullWindow;
else else
...@@ -4140,12 +3989,6 @@ ProcGrabPointer(ClientPtr client) ...@@ -4140,12 +3989,6 @@ ProcGrabPointer(ClientPtr client)
tempGrab.keyboardMode = stuff->keyboardMode; tempGrab.keyboardMode = stuff->keyboardMode;
tempGrab.pointerMode = stuff->pointerMode; tempGrab.pointerMode = stuff->pointerMode;
tempGrab.device = device; 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); (*device->ActivateGrab)(device, &tempGrab, time, FALSE);
if (oldCursor) if (oldCursor)
FreeCursor (oldCursor, (Cursor)0); FreeCursor (oldCursor, (Cursor)0);
...@@ -4209,12 +4052,6 @@ ProcUngrabPointer(ClientPtr client) ...@@ -4209,12 +4052,6 @@ ProcUngrabPointer(ClientPtr client)
TimeStamp time; TimeStamp time;
REQUEST(xResourceReq); REQUEST(xResourceReq);
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcUngrabPointer: client [%d].\n", client -> index);
}
#endif
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
UpdateCurrentTime(); UpdateCurrentTime();
grab = device->grab; grab = device->grab;
...@@ -4222,25 +4059,7 @@ ProcUngrabPointer(ClientPtr client) ...@@ -4222,25 +4059,7 @@ ProcUngrabPointer(ClientPtr client)
if ((CompareTimeStamps(time, currentTime) != LATER) && if ((CompareTimeStamps(time, currentTime) != LATER) &&
(CompareTimeStamps(time, device->grabTime) != EARLIER) && (CompareTimeStamps(time, device->grabTime) != EARLIER) &&
(grab) && SameClient(grab, client)) (grab) && SameClient(grab, client))
#ifdef NX_DEBUG_INPUT
{
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcUngrabPointer: Deactivating grab on pointer.\n");
}
#endif
(*device->DeactivateGrab)(device); (*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; return Success;
} }
...@@ -4295,12 +4114,6 @@ GrabDevice(register ClientPtr client, register DeviceIntPtr dev, ...@@ -4295,12 +4114,6 @@ GrabDevice(register ClientPtr client, register DeviceIntPtr dev,
tempGrab.pointerMode = other_mode; tempGrab.pointerMode = other_mode;
tempGrab.eventMask = mask; tempGrab.eventMask = mask;
tempGrab.device = dev; 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); (*dev->ActivateGrab)(dev, &tempGrab, time, FALSE);
*status = GrabSuccess; *status = GrabSuccess;
} }
...@@ -4314,12 +4127,6 @@ ProcGrabKeyboard(ClientPtr client) ...@@ -4314,12 +4127,6 @@ ProcGrabKeyboard(ClientPtr client)
REQUEST(xGrabKeyboardReq); REQUEST(xGrabKeyboardReq);
int result; int result;
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcGrabKeyboard: client [%d].\n", client -> index);
}
#endif
REQUEST_SIZE_MATCH(xGrabKeyboardReq); REQUEST_SIZE_MATCH(xGrabKeyboardReq);
#ifdef XCSECURITY #ifdef XCSECURITY
if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard, TRUE)) if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard, TRUE))
...@@ -4350,12 +4157,6 @@ ProcUngrabKeyboard(ClientPtr client) ...@@ -4350,12 +4157,6 @@ ProcUngrabKeyboard(ClientPtr client)
TimeStamp time; TimeStamp time;
REQUEST(xResourceReq); REQUEST(xResourceReq);
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcUngrabKeyboard: client [%d].\n", client -> index);
}
#endif
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
UpdateCurrentTime(); UpdateCurrentTime();
grab = device->grab; grab = device->grab;
...@@ -4363,25 +4164,7 @@ ProcUngrabKeyboard(ClientPtr client) ...@@ -4363,25 +4164,7 @@ ProcUngrabKeyboard(ClientPtr client)
if ((CompareTimeStamps(time, currentTime) != LATER) && if ((CompareTimeStamps(time, currentTime) != LATER) &&
(CompareTimeStamps(time, device->grabTime) != EARLIER) && (CompareTimeStamps(time, device->grabTime) != EARLIER) &&
(grab) && SameClient(grab, client)) (grab) && SameClient(grab, client))
#ifdef NX_DEBUG_INPUT
{
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcUngrabKeyboard: Deactivating grab on keyboard.\n");
}
#endif
(*device->DeactivateGrab)(device); (*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; return Success;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment