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
......
...@@ -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;
} }
......
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