Commit 22914447 authored by Reinhard Tartler's avatar Reinhard Tartler

Imported nxagent-3.3.0-18.tar.gz

Summary: Imported nxagent-3.3.0-18.tar.gz Keywords: Imported nxagent-3.3.0-18.tar.gz into Git repository
parent fc05e5e0
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 nxagent-3.3.0-13
- Handle the window unmap immediately. Don't add it to the configure - Handle the window unmap immediately. Don't add it to the configure
......
...@@ -681,6 +681,30 @@ void nxagentCollectPropertyEvent(int resource) ...@@ -681,6 +681,30 @@ 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,10 +291,21 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen) ...@@ -291,10 +291,21 @@ 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 nxagentFontsReplacement; extern int nxagentFontsReplacementDialogPid;
extern int nxagentEnableRandRModeDialogPid; extern int nxagentEnableRandRModeDialogPid;
extern int nxagentDisableRandRModeDialogPid; extern int nxagentDisableRandRModeDialogPid;
extern int nxagentEnableDeferModePid; extern int nxagentEnableDeferModePid;
......
...@@ -453,6 +453,21 @@ static void nxagentSigchldHandler(int signal) ...@@ -453,6 +453,21 @@ 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);
......
...@@ -594,6 +594,8 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -594,6 +594,8 @@ 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;
...@@ -605,6 +607,91 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -605,6 +607,91 @@ 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 &&
......
...@@ -60,6 +60,27 @@ typedef struct ...@@ -60,6 +60,27 @@ 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
...@@ -429,6 +450,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -429,6 +450,7 @@ 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;
...@@ -489,7 +511,21 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -489,7 +511,21 @@ 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))
...@@ -504,17 +540,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -504,17 +540,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
nxagentSynchronizeRegion((DrawablePtr) icon, NullRegion, NEVER_BREAK, NULL); nxagentSynchronizeRegion((DrawablePtr) icon, NullRegion, NEVER_BREAK, NULL);
} }
wmHints.icon_pixmap = nxagentPixmap(icon); propHints.iconPixmap = nxagentPixmap(icon);
} }
else else
{ {
wmHints.flags &= ~IconPixmapHint; propHints.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
} }
} }
...@@ -526,17 +562,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -526,17 +562,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
if (icon) if (icon)
{ {
wmHints.icon_window = nxagentWindow(icon); propHints.iconWindow = nxagentWindow(icon);
} }
else else
{ {
wmHints.flags &= ~IconWindowHint; propHints.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
} }
} }
...@@ -548,17 +584,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -548,17 +584,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
if (icon) if (icon)
{ {
wmHints.icon_mask = nxagentPixmap(icon); propHints.iconMask = nxagentPixmap(icon);
} }
else else
{ {
wmHints.flags &= ~IconMaskHint; propHints.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
} }
} }
...@@ -570,17 +606,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -570,17 +606,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
if (window) if (window)
{ {
wmHints.window_group = nxagentWindow(window); propHints.windowGroup = nxagentWindow(window);
} }
else else
{ {
wmHints.flags &= ~WindowGroupHint; propHints.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
} }
} }
......
...@@ -3693,7 +3693,8 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg, ...@@ -3693,7 +3693,8 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg,
return; return;
} }
void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, int yorg, WindowPtr pWin) void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg,
int yorg, WindowPtr pWin)
{ {
PixmapPtr pVirtualPixmap; PixmapPtr pVirtualPixmap;
RegionPtr clipRegion; RegionPtr clipRegion;
...@@ -3709,6 +3710,14 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, int ...@@ -3709,6 +3710,14 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, int
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);
......
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