Commit 1a74e032 authored by Reinhard Tartler's avatar Reinhard Tartler

Imported nxagent-3.3.0-10.tar.gz

Summary: Imported nxagent-3.3.0-10.tar.gz Keywords: Imported nxagent-3.3.0-10.tar.gz into Git repository
parent 97fe7650
......@@ -1140,13 +1140,13 @@ static void nxagentParseOptions(char *name, char *value)
}
else if (!strcmp(name, "resize"))
{
if (!strcmp(value, "1"))
if (nxagentOption(DesktopResize) == 0 || strcmp(value, "0") == 0)
{
nxagentResizeDesktopAtStartup = True;
nxagentResizeDesktopAtStartup = 0;
}
else if (!strcmp(value, "0"))
else if (strcmp(value, "1") == 0)
{
nxagentResizeDesktopAtStartup = False;
nxagentResizeDesktopAtStartup = 1;
}
else
{
......@@ -2080,8 +2080,8 @@ void nxagentSetDeferLevel()
deferTimeout = 200;
tileWidth = 65536;
tileHeight = 65536;
tileWidth = 4096;
tileHeight = 4096;
break;
}
......@@ -2091,8 +2091,8 @@ void nxagentSetDeferLevel()
deferTimeout = 200;
tileWidth = 65536;
tileHeight = 65536;
tileWidth = 4096;
tileHeight = 4096;
break;
}
......@@ -2103,8 +2103,8 @@ void nxagentSetDeferLevel()
deferTimeout = 200;
tileWidth = 65536;
tileHeight = 65536;
tileWidth = 4096;
tileHeight = 4096;
break;
}
......
ChangeLog:
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.
nxagent-3.3.0-5
- Disabled verbose logging in Rootless.c.
nxagent-3.3.0-4
- Fix the XKB map load in the case of 64 bit server.
nxagent-3.3.0-3
- Fixed TR10F02119. If the remote X display is using evdev keyboard
then copy maps from remote.
- Upgraded VERSION to 3.3.0.
nxagent-3.3.0-2
- Fixed TR10F02115. Painting errors occurred when screen areas beyond
the current viewport became viewable in the NX Client for Windows.
- Using a new struct type nxagentWMHints to avoid type mismatch on
64 bit platforms.
- Added debug utilities for pointer input.
nxagent-3.3.0-1
- Opened the 3.3.0 branch based on nxagent-3.2.0-12.
nxagent-3.2.0-12
- Ignore 'resize' option at reconnection if viewport mode is on.
- Fixed TR08E01814. Added shadow keymap initialization in order to
enable nxcompshad to translate keycodes across different layouts.
nxagent-3.2.0-11
- Fixed TR08F02098. Function splitting font names has to be instruct-
ed to handle the right number of fields.
nxagent-3.2.0-10
- Extended fix for TR07F02091 to include font names having zero in
fields RESOLUTION_X and RESOLUTION_Y.
nxagent-3.2.0-9
- Fixed TR07F02091. Scalable fonts were not correctly listed among
available fonts.
- Fixed TR06F02080. Use the corrupted area extents as maximum size of
the image data.
nxagent-3.2.0-8
- Fixed TR07F02082. The agent server could be unable to init core
......
......@@ -32,6 +32,7 @@
#include "Handlers.h"
#include "Pixels.h"
#include "Reconnect.h"
#include "GCOps.h"
#include "NXlib.h"
......@@ -371,6 +372,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
int nBox;
int x, y;
int w, h;
int extentWidth, extentHeight;
int tileWidth, tileHeight;
int length, format, leftPad;
int i;
......@@ -417,13 +419,14 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
if (useStoredBitmap != 0)
{
#ifdef TEST
fprintf(stderr, "nxagentSynchronizeRegion: Drawable [%s] at [%p] has a synchronization bitmap "
fprintf(stderr, "nxagentSynchronizeRegion: Drawable [%s] at [%p] has a synchronization bitmap at [%p] "
"[%d,%d,%d,%d] with [%ld] rects.\n", nxagentDrawableType(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))));
(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))));
#endif
clipRegion = nxagentCreateRegion(pDrawable, NULL, 0, 0, pDrawable -> width, pDrawable -> height);
......@@ -580,8 +583,7 @@ 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), (pDrawable -> type == DRAWABLE_PIXMAP ? "Pixmap" : "Window"),
(void *) pDrawable);
REGION_NUM_RECTS(clipRegion), nxagentDrawableType(pDrawable), (void *) pDrawable);
fprintf(stderr, "nxagentSynchronizeRegion: Extents geometry [%d,%d,%d,%d].\n",
clipRegion -> extents.x1, clipRegion -> extents.y1, clipRegion -> extents.x2, clipRegion -> extents.y2);
......@@ -590,8 +592,20 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
pDrawable -> x, pDrawable -> y, pDrawable -> width, pDrawable -> height);
#endif
w = tileWidth = (nxagentOption(TileWidth) > pDrawable -> width ? pDrawable -> width : nxagentOption(TileWidth));
h = tileHeight = (nxagentOption(TileHeight) > pDrawable -> height ? pDrawable -> height : nxagentOption(TileHeight));
/*
* We are going to synchronize the corrupted
* area, so we use the corrupted extents as
* maximum size of the image data. It's im-
* portant to avoid using the drawable size,
* because in case of a huge window it had to
* result in a failed data memory allocation.
*/
extentWidth = clipRegion -> extents.x2 - clipRegion -> extents.x1;
extentHeight = clipRegion -> extents.y2 - clipRegion -> extents.y1;
w = tileWidth = (nxagentOption(TileWidth) > extentWidth ? extentWidth : nxagentOption(TileWidth));
h = tileHeight = (nxagentOption(TileHeight) > extentHeight ? extentHeight : nxagentOption(TileHeight));
#ifdef DEBUG
fprintf(stderr, "nxagentSynchronizeRegion: Using tiles of size [%dx%d].\n", tileWidth, tileHeight);
......@@ -602,7 +616,22 @@ 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;
......@@ -657,10 +686,14 @@ 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;
......@@ -735,9 +768,6 @@ 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.
......@@ -792,6 +822,13 @@ 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
{
......@@ -822,6 +859,14 @@ 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)
......@@ -2542,16 +2587,13 @@ 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 drawable at [%p].\n",
(void *) pDrawable);
fprintf(stderr, "nxagentCreateDrawableBitmap: Creating synchronization bitmap for [%s] at [%p].\n",
nxagentDrawableType(pDrawable), (void *) pDrawable);
#endif
/*
......@@ -2613,7 +2655,10 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable)
* FIXME: A better way it would be create the bitmap
* with the same extents of the clipRegion. This
* requires to save the offset with respect to the
* drawable origin like in the backing store.
* drawable origin like in the backing store. This
* becomes particularly important when the drawable
* is a huge window, because the pixmap creation
* would fail.
*/
pBitmap = nxagentCreatePixmap(pDrawable -> pScreen, pDrawable -> width, pDrawable -> height, pDrawable -> depth);
......@@ -2636,24 +2681,8 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable)
w = pClipRegion -> extents.x2 - pClipRegion -> extents.x1;
h = pClipRegion -> extents.y2 - pClipRegion -> extents.y1;
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;
}
nxagentCopyArea(pDrawable, (DrawablePtr) pBitmap, pGC, x, y, w, h, x, y);
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);
......@@ -2695,11 +2724,6 @@ nxagentCreateDrawableBitmapEnd:
nxagentFreeRegion(pDrawable, pClipRegion);
}
if (data != NULL)
{
xfree(data);
}
if (pGC != NULL)
{
FreeScratchGC(pGC);
......@@ -3075,6 +3099,16 @@ 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:
......
......@@ -63,7 +63,13 @@
#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"
......@@ -113,6 +119,10 @@ extern int nxagentSplashCount;
extern int nxagentLastClipboardClient;
#ifdef NX_DEBUG_INPUT
int nxagentDebugInput = 0;
#endif
#ifdef DEBUG
extern Bool nxagentRootlessTreesMatch(void);
#endif
......@@ -172,6 +182,8 @@ static Cursor viewportCursor;
static Mask defaultEventMask;
static int lastEventSerial = 0;
#define MAX_INC 200
#define INC_STEP 5
#define nextinc(x) ((x) < MAX_INC ? (x) += INC_STEP : (x))
......@@ -252,6 +264,13 @@ void nxagentRemoveDuplicatedKeys(XEvent *X);
void ProcessInputEvents()
{
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInput == 1)
{
fprintf(stderr, "ProcessInputEvents: Processing input.\n");
}
#endif
mieqProcessInputEvents();
}
......@@ -282,6 +301,11 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen)
nxagentRRSetScreenConfig(pScreen, nxagentOption(Width), nxagentOption(Height));
if (nxagentOption(ClientOs) == ClientOsWinnt)
{
NXSetExposeParameters(nxagentDisplay, 0, 0, 0);
}
sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
}
......@@ -771,8 +795,9 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
}
x.u.u.type = KeyRelease;
x.u.u.detail = X.xkey.keycode;
x.u.keyButtonPointer.time = nxagentLastKeyPressTime + (X.xkey.time - nxagentLastServerTime);
x.u.u.detail = nxagentConvertKeycode(X.xkey.keycode);
x.u.keyButtonPointer.time = nxagentLastKeyPressTime +
(X.xkey.time - nxagentLastServerTime);
nxagentLastServerTime = X.xkey.time;
......@@ -794,8 +819,11 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
}
case ButtonPress:
{
#ifdef TEST
fprintf(stderr, "nxagentDispatchEvents: Going to handle new ButtonPress event.\n");
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInput == 1)
{
fprintf(stderr, "nxagentDispatchEvents: Going to handle new ButtonPress event.\n");
}
#endif
nxagentInputEvent = 1;
......@@ -860,6 +888,13 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
x.u.keyButtonPointer.rootY = X.xmotion.y - nxagentOption(RootY);
}
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInput == 1)
{
fprintf(stderr, "nxagentDispatchEvents: Adding ButtonPress event.\n");
}
#endif
mieqEnqueue(&x);
CriticalOutputPending = 1;
......@@ -887,8 +922,11 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
}
case ButtonRelease:
{
#ifdef TEST
fprintf(stderr, "nxagentDispatchEvents: Going to handle new ButtonRelease event.\n");
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInput == 1)
{
fprintf(stderr, "nxagentDispatchEvents: Going to handle new ButtonRelease event.\n");
}
#endif
nxagentInputEvent = 1;
......@@ -923,6 +961,13 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
x.u.keyButtonPointer.rootY = X.xmotion.y - nxagentOption(RootY);
}
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInput == 1)
{
fprintf(stderr, "nxagentDispatchEvents: Adding ButtonRelease event.\n");
}
#endif
mieqEnqueue(&x);
CriticalOutputPending = 1;
......@@ -956,12 +1001,15 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
fprintf(stderr, "nxagentDispatchEvents: Going to handle new MotionNotify event.\n");
#endif
#ifdef TEST
fprintf(stderr, "nxagentDispatchEvents: Handling motion notify window [%ld] root [%ld] child [%ld].\n",
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInput == 1)
{
fprintf(stderr, "nxagentDispatchEvents: Handling motion notify window [%ld] root [%ld] child [%ld].\n",
X.xmotion.window, X.xmotion.root, X.xmotion.subwindow);
fprintf(stderr, "nxagentDispatchEvents: Pointer at [%d][%d] relative root [%d][%d].\n",
fprintf(stderr, "nxagentDispatchEvents: Pointer at [%d][%d] relative root [%d][%d].\n",
X.xmotion.x, X.xmotion.y, X.xmotion.x_root, X.xmotion.y_root);
}
#endif
x.u.u.type = MotionNotify;
......@@ -975,18 +1023,17 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
nxagentLastEnteredWindow = pWin;
}
if (nxagentPulldownDialogPid == 0 && (X.xmotion.y_root <
nxagentLastEnteredTopLevelWindow -> drawable.y + 4))
if (nxagentPulldownDialogPid == 0 && nxagentLastEnteredTopLevelWindow &&
(X.xmotion.y_root < nxagentLastEnteredTopLevelWindow -> drawable.y + 4))
{
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)
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)
{
nxagentPulldownDialog(nxagentLastEnteredTopLevelWindow -> drawable.id);
}
......@@ -1008,6 +1055,14 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
X.xmotion.window == nxagentDefaultWindows[pScreen -> myNum]
&& X.xmotion.subwindow == None))
{
#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);
}
#endif
mieqEnqueue(&x);
}
......@@ -1644,6 +1699,21 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
} /* End of switch (X.type) */
if (X.xany.serial < lastEventSerial)
{
/*
* Start over.
*/
nxagentDeleteStaticResizedWindow(0);
}
else
{
nxagentDeleteStaticResizedWindow(X.xany.serial - 1);
}
lastEventSerial = X.xany.serial;
} /* End of while (...) */
/*
......@@ -1848,8 +1918,9 @@ int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result)
nxagentLastEventTime = nxagentLastKeyPressTime = GetTimeInMillis();
x.u.u.type = KeyPress;
x.u.u.detail = X -> xkey.keycode;
x.u.u.detail = nxagentConvertKeycode(X -> xkey.keycode);
x.u.keyButtonPointer.time = nxagentLastKeyPressTime;
nxagentLastServerTime = X -> xkey.time;
......@@ -1914,6 +1985,8 @@ int nxagentHandleExposeEvent(XEvent *X)
int index = 0;
int overlap = 0;
StaticResizedWindowStruct *resizedWinPtr = NULL;
#ifdef DEBUG
fprintf(stderr, "nxagentHandleExposeEvent: Checking remote expose events.\n");
#endif
......@@ -1944,6 +2017,19 @@ FIXME: This can be maybe optimized by consuming the
box.x1 = pWin -> drawable.x + wBorderWidth(pWin) + X -> xexpose.x;
box.y1 = pWin -> drawable.y + wBorderWidth(pWin) + X -> xexpose.y;
resizedWinPtr = nxagentFindStaticResizedWindow(X -> xany.serial);
while (resizedWinPtr)
{
if (resizedWinPtr -> pWin == pWin)
{
box.x1 += resizedWinPtr -> offX;
box.y1 += resizedWinPtr -> offY;
}
resizedWinPtr = resizedWinPtr -> prev;
}
box.x2 = box.x1 + X -> xexpose.width;
box.y2 = box.y1 + X -> xexpose.height;
......@@ -3913,3 +3999,27 @@ int nxagentWaitEvents(Display *dpy, struct timeval *tm)
return 1;
}
#ifdef NX_DEBUG_INPUT
void nxagentDumpInputInfo(void)
{
fprintf(stderr, "Dumping input info ON.\n");
}
void nxagentGuessDumpInputInfo(ClientPtr client, Atom property, char *data)
{
if (strcmp(validateString(NameForAtom(property)), "NX_DEBUG_INPUT") == 0)
{
if (*data != 0)
{
nxagentDebugInput = 1;
}
else
{
nxagentDebugInput = 0;
}
}
}
#endif
......@@ -65,26 +65,34 @@ 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/X11R6/lib/X11/fonts/100dpi/,/usr/X11R6/lib/X11/fonts/TTF/,\
/usr/NX/share/fonts/base"
#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/share/X11/fonts/100dpi/,/usr/share/X11/fonts/TTF/,\
/usr/NX/share/fonts/base"
#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/share/fonts/X11/100dpi/,/usr/share/fonts/X11/TTF/,\
/usr/NX/share/fonts/base"
#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/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_RECONNECT_FONT_DEBUG
......@@ -101,6 +109,8 @@ static XFontStruct *nxagentLoadQueryFont(register Display *dpy , char *fontName
int nxagentFreeFont(XFontStruct *fs);
static Bool nxagentGetFontServerPath(char * fontServerPath);
static char * nxagentMakeScalableFontName(const char *fontName, int scalableResolution);
RESTYPE RT_NX_FONT;
#ifdef NXAGENT_RECONNECT_FONT_DEBUG
......@@ -419,13 +429,59 @@ Bool nxagentFontFind(const char *name, int *pos)
Bool nxagentFontLookUp(const char *name)
{
int i;
if (name)
if (!strlen(name))
return 0;
if (nxagentFontFind(name, &i))
return (nxagentRemoteFontList.list[i]->status > 0);
else
int result;
char *scalable;
if (name != NULL && strlen(name) == 0)
{
return 0;
}
result = nxagentFontFind(name, &i);
scalable = NULL;
/*
* Let's try with the scalable font description.
*/
if (result == 0)
{
scalable = nxagentMakeScalableFontName(name, 0);
if (scalable != NULL)
{
result = nxagentFontFind(scalable, &i);
free(scalable);
}
}
/*
* Let's try again after replacing zero to xdpi and ydpi in the pattern.
*/
if (result == 0)
{
scalable = nxagentMakeScalableFontName(name, 1);
if (scalable != NULL)
{
result = nxagentFontFind(scalable, &i);
free(scalable);
}
}
if (result == 0)
{
return 0;
}
else
{
return (nxagentRemoteFontList.list[i]->status > 0);
}
}
Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont)
......@@ -700,7 +756,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP
substFontBuf = (char *) xalloc(sizeof(char) * 512);
numFontFields = nxagentSplitString(fontName, fontNameFields, FIELDS, "-");
numFontFields = nxagentSplitString(fontName, fontNameFields, FIELDS + 1, "-");
memcpy(substFontBuf, "fixed\0", strlen("fixed") + 1);
......@@ -1505,6 +1561,31 @@ 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
......@@ -1698,3 +1779,88 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep)
return i;
}
char *nxagentMakeScalableFontName(const char *fontName, int scalableResolution)
{
char *scalableFontName;
const char *s;
int len;
int field;
len = strlen(fontName) + 1;
scalableFontName = malloc(len);
if (scalableFontName == NULL)
{
#ifdef PANIC
fprintf(stderr, "nxagentMakeScalableFontName: PANIC! malloc() failed.\n");
#endif
return NULL;
}
scalableFontName[0] = 0;
if (*fontName != '-')
{
goto MakeScalableFontNameError;
}
s = fontName;
field = 0;
while (s != NULL)
{
s = strchr(s + 1, '-');
if (s != NULL)
{
if (field == 6 || field == 7 || field == 11)
{
/*
* PIXEL_SIZE || POINT_SIZE || AVERAGE_WIDTH
*/
strcat(scalableFontName, "-0");
}
else if (scalableResolution == 1 && (field == 8 || field == 9))
{
/*
* RESOLUTION_X || RESOLUTION_Y
*/
strcat(scalableFontName, "-0");
}
else
{
strncat(scalableFontName, fontName, s - fontName);
}
fontName = s;
}
else
{
strcat(scalableFontName, fontName);
}
field++;
}
if (field != 14)
{
goto MakeScalableFontNameError;
}
return scalableFontName;
MakeScalableFontNameError:
free(scalableFontName);
#ifdef DEBUG
fprintf(stderr, "nxagentMakeScalableFontName: Invalid font name.\n");
#endif
return NULL;
}
......@@ -205,6 +205,7 @@ DEFINES = -g $(OS_DEFINES) $(EXT_DEFINES) $(UPG_DEFINES) \
-DNXAGENT_ONSTART \
-DNXAGENT_SPLASH \
-DNXAGENT_ARTSD \
-UNX_DEBUG_INPUT \
-UPANORAMIX
all:: $(OBJS)
......
......@@ -74,7 +74,7 @@ is" without express or implied warranty.
#undef DEBUG
#undef DUMP
#define NXAGENT_VERSION "3.2.0"
#define NXAGENT_VERSION "3.3.0"
/*
* ProcVector array defined in tables.c.
......
......@@ -109,6 +109,10 @@ void nxagentEnableXkbExtension(void);
void nxagentTuneXkbWrapper(void);
void nxagentResetKeycodeConversion(void);
#endif
CARD8 nxagentConvertKeycode(CARD8 k);
#endif /* __Keyboard_H__ */
......@@ -547,28 +547,29 @@ Bool nxagentReconnectSession(void)
goto nxagentReconnectError;
}
if (nxagentOption(ResetKeyboardAtResume))
if (nxagentOption(ResetKeyboardAtResume) == 1 &&
(nxagentKeyboard == NULL || nxagentOldKeyboard == NULL ||
strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 ||
strcmp(nxagentKeyboard, "query") == 0))
{
if (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL ||
strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 ||
strcmp(nxagentKeyboard, "query") == 0)
if (nxagentResetKeyboard() == 0)
{
if (nxagentResetKeyboard() == 0)
#ifdef WARNING
if (nxagentVerbose == 1)
{
#ifdef WARNING
if (nxagentVerbose == 1)
{
fprintf(stderr, "nxagentReconnect: Failed to reset keyboard device.\n");
}
#endif
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;
......
......@@ -2270,8 +2270,7 @@ void nxagentAddGlyphs(GlyphSetPtr glyphSet, Glyph *gids, xGlyphInfo *gi,
normalizedImages = NULL;
if (glyphDepths[glyphSet -> fdepth] == 1 &&
nxagentServerOrder() != BitmapBitOrder(nxagentDisplay))
if (sizeImages > 0)
{
normalizedImages = xalloc(sizeImages);
......@@ -2279,7 +2278,11 @@ void nxagentAddGlyphs(GlyphSetPtr glyphSet, Glyph *gids, xGlyphInfo *gi,
{
memcpy(normalizedImages, images, sizeImages);
BitOrderInvert ((unsigned char *) normalizedImages, sizeImages);
if (glyphDepths[glyphSet -> fdepth] == 1 &&
nxagentServerOrder() != BitmapBitOrder(nxagentDisplay))
{
BitOrderInvert ((unsigned char *) normalizedImages, sizeImages);
}
}
else
{
......
......@@ -46,6 +46,20 @@
* initialized.
*/
typedef struct
{
CARD32 flags;
CARD32 input;
CARD32 initial_state;
CARD32 icon_pixmap;
CARD32 icon_window;
INT32 icon_x;
INT32 icon_y;
CARD32 icon_mask;
CARD32 window_group;
}
nxagentWMHints;
WindowPtr nxagentRootlessWindow = NULL;
#define TOP_LEVEL_TABLE_UNIT 100
......@@ -414,7 +428,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
char *propertyS, *typeS;
Atom propertyX, typeX;
char *output = NULL;
XWMHints wmHints;
nxagentWMHints wmHints;
Bool export = False;
Bool freeMem = False;
......@@ -470,7 +484,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
else if (strcmp(typeS, "WM_HINTS") == 0)
{
ClientPtr pClient = wClient(pWin);
wmHints = *(XWMHints*)value;
wmHints = *(nxagentWMHints*)value;
wmHints.flags |= InputHint;
wmHints.input = True;
......@@ -497,9 +511,10 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
wmHints.flags &= ~IconPixmapHint;
#ifdef WARNING
fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon pixmap %lx from hint "
fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon pixmap %x from hint "
"exporting property %s type %s on window %p.\n",
wmHints.icon_pixmap, propertyS, typeS, (void*)pWin);
(unsigned int) wmHints.icon_pixmap, propertyS, typeS,
(void*)pWin);
#endif
}
}
......@@ -518,9 +533,10 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
wmHints.flags &= ~IconWindowHint;
#ifdef WARNING
fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon window %lx from hint "
fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon window %x from hint "
"exporting property %s type %s on window %p.\n",
wmHints.icon_window, propertyS, typeS, (void*)pWin);
(unsigned int) wmHints.icon_window, propertyS, typeS,
(void*)pWin);
#endif
}
}
......@@ -539,9 +555,10 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
wmHints.flags &= ~IconMaskHint;
#ifdef WARNING
fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon mask %lx from hint "
fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon mask %x from hint "
"exporting property %s type %s on window %p.\n",
wmHints.icon_mask, propertyS, typeS, (void*)pWin);
(unsigned int) wmHints.icon_mask, propertyS, typeS,
(void*)pWin);
#endif
}
}
......@@ -560,9 +577,10 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
wmHints.flags &= ~WindowGroupHint;
#ifdef WARNING
fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up window group %lx from hint "
fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up window group %x from hint "
"exporting property %s type %s on window %p.\n",
wmHints.window_group, propertyS, typeS, (void*)pWin);
(unsigned int) wmHints.window_group, propertyS, typeS,
(void*)pWin);
#endif
}
}
......@@ -654,7 +672,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
{
#ifdef TEST
fprintf(stderr, "nxagentExportProperty: WARNING! Ignored ChangeProperty "
"on %swindow %lx property %s type %s nUnits %ld format %d\n",
"on %swindow %x property %s type %s nUnits %ld format %d\n",
nxagentWindowTopLevel(pWin) ? "toplevel " : "",
nxagentWindow(pWin), validateString(propertyS), validateString(typeS),
nUnits, format);
......@@ -683,7 +701,7 @@ void nxagentImportProperty(Window window,
WindowPtr pWin;
Bool import = False;
Bool freeMem = False;
XWMHints wmHints;
nxagentWMHints wmHints;
typedef struct {
CARD32 state;
......@@ -797,7 +815,7 @@ void nxagentImportProperty(Window window,
}
else if (strcmp(typeS, "WM_HINTS") == 0)
{
wmHints = *(XWMHints*)buffer;
wmHints = *(nxagentWMHints*)buffer;
output = (char*) &wmHints;
import = True;
......@@ -815,8 +833,9 @@ void nxagentImportProperty(Window window,
#ifdef WARNING
fprintf(stderr, "nxagentImportProperty: WARNING! Failed to look up remote icon "
"pixmap %ld from hint importing property [%ld] type %s on window %p.\n",
wmHints.icon_pixmap, (long int) property, typeS, (void *) pWin);
"pixmap %d from hint importing property [%ld] type %s on window %p.\n",
(unsigned int) wmHints.icon_pixmap, (long int) property,
typeS, (void *) pWin);
#endif
}
}
......@@ -835,8 +854,9 @@ void nxagentImportProperty(Window window,
#ifdef WARNING
fprintf(stderr, "nxagenImportProperty: WARNING! Failed to look up remote icon "
"window %lx from hint importing property [%ld] type %s on window %p.\n",
wmHints.icon_window, (long int) property, typeS, (void *) pWin);
"window %x from hint importing property [%ld] type %s on window %p.\n",
(unsigned int) wmHints.icon_window,
(long int) property, typeS, (void *) pWin);
#endif
}
}
......@@ -855,8 +875,8 @@ void nxagentImportProperty(Window window,
#ifdef WARNING
fprintf(stderr, "nxagentImportProperty: WARNING! Failed to look up remote icon "
"mask %lx from hint importing property [%ld] type %s on window %p.\n",
wmHints.icon_mask, (long int) property, typeS, (void *) pWin);
"mask %x from hint importing property [%ld] type %s on window %p.\n",
(unsigned int) wmHints.icon_mask, (long int) property, typeS, (void *) pWin);
#endif
}
}
......@@ -875,8 +895,9 @@ void nxagentImportProperty(Window window,
#ifdef WARNING
fprintf(stderr, "nxagentImportProperty: WARNING! Failed to look up remote window "
"group %lx from hint importing property [%ld] type %s on window %p.\n",
wmHints.window_group, (long int) property, typeS, (void *) pWin);
"group %x from hint importing property [%ld] type %s on window %p.\n",
(unsigned int) wmHints.window_group,
(long int) property, typeS, (void *) pWin);
#endif
}
}
......
......@@ -958,7 +958,8 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen,
nxagentChangeOption(Fullscreen, True);
if (nxagentOption(ClientOs) == ClientOsWinnt)
if (nxagentOption(ClientOs) == ClientOsWinnt &&
(nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup))
{
NXSetExposeParameters(nxagentDisplay, 0, 0, 0);
}
......
......@@ -1136,6 +1136,11 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
{
unsigned int valuemask;
XWindowChanges values;
int offX, offY;
int i, j;
offX = nxagentWindowPriv(pWin)->x - pWin->origin.x;
offY = nxagentWindowPriv(pWin)->y - pWin->origin.y;
if (nxagentScreenTrap == 1)
{
......@@ -1221,6 +1226,29 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
(void *) pWin, nxagentWindow(pWin), valuemask);
#endif
if (pWin->bitGravity == StaticGravity &&
((mask & CWX) || (mask & CWY)) &&
((mask & CWWidth) || (mask & CWHeight)))
{
#ifdef TEST
fprintf(stderr, "nxagentConfigureWindow: Window has StaticGravity. Going to translate Expose events by offset [%d, %d].\n",
offX, offY);
#endif
nxagentAddStaticResizedWindow(pWin, XNextRequest(nxagentDisplay), offX, offY);
for (j = 0; j < nxagentExposeQueue.length; j++)
{
i = (nxagentExposeQueue.start + j) % EXPOSED_SIZE;
if (nxagentExposeQueue.exposures[i].pWindow == pWin &&
nxagentExposeQueue.exposures[i].remoteRegion != NullRegion)
{
REGION_TRANSLATE(pWin -> drawable.pScreen, nxagentExposeQueue.exposures[i].remoteRegion, offX, offY);
}
}
}
XConfigureWindow(nxagentDisplay, nxagentWindow(pWin), valuemask, &values);
MAKE_SYNC_CONFIGURE_WINDOW;
......@@ -3424,6 +3452,105 @@ void nxagentDeleteConfiguredWindow(WindowPtr pWin)
return;
}
void nxagentAddStaticResizedWindow(WindowPtr pWin, unsigned long sequence, int offX, int offY)
{
if (nxagentStaticResizedWindowList == NULL)
{
nxagentStaticResizedWindowList = malloc(sizeof(StaticResizedWindowStruct));
nxagentStaticResizedWindowList -> next = NULL;
nxagentStaticResizedWindowList -> prev = NULL;
}
else
{
StaticResizedWindowStruct *tmp;
tmp = malloc(sizeof(StaticResizedWindowStruct));
tmp -> next = nxagentStaticResizedWindowList;
nxagentStaticResizedWindowList -> prev = tmp;
tmp -> prev = NULL;
nxagentStaticResizedWindowList = tmp;
}
nxagentStaticResizedWindowList -> pWin = pWin;
nxagentStaticResizedWindowList -> sequence = sequence;
nxagentStaticResizedWindowList -> offX = offX;
nxagentStaticResizedWindowList -> offY = offY;
}
void nxagentDeleteStaticResizedWindow(unsigned long sequence)
{
StaticResizedWindowStruct *index, *previous, *tmp;
index = nxagentStaticResizedWindowList;
while (index)
{
if (index -> sequence <= sequence)
{
if (index -> prev == NULL && index -> next == NULL)
{
free(nxagentStaticResizedWindowList);
nxagentStaticResizedWindowList = NULL;
return;
}
else if (index -> prev == NULL)
{
tmp = nxagentStaticResizedWindowList;
index = nxagentStaticResizedWindowList = tmp -> next;
free(tmp);
nxagentStaticResizedWindowList -> prev = NULL;
continue;
}
else if (index -> next == NULL)
{
tmp = index;
index = index -> prev;
free(tmp);
index -> next = NULL;
return;
}
previous = index -> prev;
tmp = index;
index = index -> next;
previous -> next = index;
index -> prev = previous;
free(tmp);
continue;
}
index = index -> next;
}
return;
}
StaticResizedWindowStruct *nxagentFindStaticResizedWindow(unsigned long sequence)
{
StaticResizedWindowStruct *index;
StaticResizedWindowStruct *ret = NULL;
if (nxagentStaticResizedWindowList == NULL)
{
return NULL;
}
index = nxagentStaticResizedWindowList;
while (index && index -> sequence > sequence)
{
ret = index;
index = index -> next;
}
return ret;
}
void nxagentEmptyBackingStoreRegion(pointer param0, XID param1, pointer data_buffer)
{
WindowPtr pWin = (WindowPtr) param0;
......
......@@ -287,6 +287,18 @@ typedef struct _ConfiguredWindow
ConfiguredWindowStruct *nxagentConfiguredWindowList;
typedef struct _StaticResizedWindow
{
WindowPtr pWin;
struct _StaticResizedWindow *next;
struct _StaticResizedWindow *prev;
unsigned long sequence;
int offX;
int offY;
} StaticResizedWindowStruct;
StaticResizedWindowStruct *nxagentStaticResizedWindowList;
void nxagentPostValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind);
void nxagentFlushConfigureWindow(void);
......@@ -295,6 +307,12 @@ void nxagentAddConfiguredWindow(WindowPtr pWin, unsigned int valuemask);
void nxagentDeleteConfiguredWindow(WindowPtr pWin);
void nxagentAddStaticResizedWindow(WindowPtr pWin, unsigned long sequence, int offX, int offY);
void nxagentDeleteStaticResizedWindow(unsigned long sequence);
StaticResizedWindowStruct *nxagentFindStaticResizedWindow(unsigned long sequence);
void nxagentEmptyAllBackingStoreRegions(void);
#endif /* __Window_H__ */
......@@ -189,6 +189,10 @@ xEvent *xeviexE;
#include "Windows.h"
#include "Args.h"
#ifdef NX_DEBUG_INPUT
extern int nxagentDebugInput;
#endif
extern Display *nxagentDisplay;
extern WindowPtr nxagentLastEnteredWindow;
......@@ -1682,11 +1686,28 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask,
int i;
int type;
#ifdef DEBUG
#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
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)))
{
......@@ -1700,10 +1721,17 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask,
if (WID(inputInfo.pointer->valuator->motionHintWindow) ==
pEvents->u.keyButtonPointer.event)
{
#ifdef DEBUG
#if defined(DEBUG) || defined(NX_DEBUG_INPUT)
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInput == 1)
{
fprintf(stderr,"\nmotionHintWindow == keyButtonPointer.event\n");
}
#else
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;
......@@ -1740,16 +1768,26 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask,
}
WriteEventsToClient(client, count, pEvents);
#ifdef DEBUG
#if defined(DEBUG) || defined(NX_DEBUG_INPUT)
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInput == 1)
fprintf(stderr, " delivered\n");
#else
if (debug_events) ErrorF( " delivered\n");
#endif
#endif
return 1;
}
else
{
#ifdef DEBUG
#if defined(DEBUG) || defined(NX_DEBUG_INPUT)
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInput == 1)
fprintf(stderr, "\n");
#else
if (debug_events) ErrorF("\n");
#endif
#endif
return 0;
}
}
......@@ -3116,6 +3154,12 @@ 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;
}
......@@ -3170,14 +3214,38 @@ 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;
......@@ -3189,8 +3257,20 @@ 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);
......@@ -3201,6 +3281,36 @@ 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)
......@@ -3208,6 +3318,7 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count
else
DeliverDeviceEvents(sprite.win, xE, NullGrab, NullWindow,
mouse, count);
#endif
if (deactivateGrab)
(*mouse->DeactivateGrab)(mouse);
}
......
......@@ -189,6 +189,10 @@ xEvent *xeviexE;
#include "Windows.h"
#include "Args.h"
#ifdef NX_DEBUG_INPUT
extern int nxagentDebugInput;
#endif
extern Display *nxagentDisplay;
extern WindowPtr nxagentLastEnteredWindow;
......@@ -1682,11 +1686,28 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask,
int i;
int type;
#ifdef DEBUG
#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
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)))
{
......@@ -1700,10 +1721,17 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask,
if (WID(inputInfo.pointer->valuator->motionHintWindow) ==
pEvents->u.keyButtonPointer.event)
{
#ifdef DEBUG
#if defined(DEBUG) || defined(NX_DEBUG_INPUT)
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInput == 1)
{
fprintf(stderr,"\nmotionHintWindow == keyButtonPointer.event\n");
}
#else
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;
......@@ -1740,16 +1768,26 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask,
}
WriteEventsToClient(client, count, pEvents);
#ifdef DEBUG
#if defined(DEBUG) || defined(NX_DEBUG_INPUT)
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInput == 1)
fprintf(stderr, " delivered\n");
#else
if (debug_events) ErrorF( " delivered\n");
#endif
#endif
return 1;
}
else
{
#ifdef DEBUG
#if defined(DEBUG) || defined(NX_DEBUG_INPUT)
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInput == 1)
fprintf(stderr, "\n");
#else
if (debug_events) ErrorF("\n");
#endif
#endif
return 0;
}
}
......@@ -3116,6 +3154,12 @@ 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;
}
......@@ -3170,14 +3214,38 @@ 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;
......@@ -3189,8 +3257,20 @@ 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);
......@@ -3201,6 +3281,36 @@ 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)
......@@ -3208,6 +3318,7 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count
else
DeliverDeviceEvents(sprite.win, xE, NullGrab, NullWindow,
mouse, count);
#endif
if (deactivateGrab)
(*mouse->DeactivateGrab)(mouse);
}
......
......@@ -336,6 +336,10 @@ ProcChangeProperty(ClientPtr client)
nxagentGuessShadowHint(client, stuff->property);
#ifdef NX_DEBUG_INPUT
nxagentGuessDumpInputInfo(client, stuff->property, (char *) &stuff[1]);
#endif
return client->noClientException;
}
}
......
......@@ -336,6 +336,10 @@ ProcChangeProperty(ClientPtr client)
nxagentGuessShadowHint(client, stuff->property);
#ifdef NX_DEBUG_INPUT
nxagentGuessDumpInputInfo(client, stuff->property, (char *) &stuff[1]);
#endif
return client->noClientException;
}
}
......
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