diff options
author | Reinhard Tartler <siretart@tauware.de> | 2011-10-10 17:58:31 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2011-10-10 17:58:31 +0200 |
commit | 3e7c6697ac2631a215691c8d23a32a790db33b85 (patch) | |
tree | e45f2e0b0b03b3f1f8c7c7512d0a8219f68a7cb6 | |
parent | 9e3371021541dbb7d8428b419c2e77156b166f1a (diff) | |
download | nx-libs-nxagent/3.1.0-6.tar.gz nx-libs-nxagent/3.1.0-6.tar.bz2 nx-libs-nxagent/3.1.0-6.zip |
Imported nxagent-3.1.0-6.tar.gznxagent/3.1.0-6
Summary: Imported nxagent-3.1.0-6.tar.gz
Keywords:
Imported nxagent-3.1.0-6.tar.gz
into Git repository
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Args.c | 6 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/CHANGELOG | 31 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 2 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 16 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Events.c | 9 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Options.c | 2 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Options.h | 8 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Screen.c | 160 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c | 84 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.NX.original | 84 |
10 files changed, 379 insertions, 23 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 07526de56..5b336279e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -1215,6 +1215,12 @@ static void nxagentParseOptions(char *name, char *value) return; } + else if (strcmp(name, "copysize") == 0) + { + nxagentChangeOption(CopyBufferSize, atoi(value)); + + return; + } else { #ifdef DEBUG diff --git a/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG b/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG index 1a63ce5b6..e9138747a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG +++ b/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG @@ -1,5 +1,36 @@ ChangeLog: +nxagent-3.1.0-6 + +- Fixed a compile warning in Args.c. + +- The synchronization loop breaks if the drawable is clean when it's + not supposed to be. + +- Fixed TR12E01966. Emacs tooltips were not displayed properly. Added + a check on the event mask before calling miWindowExposures(). + +- Fixed TR01F01982. ConfigureNotify warning is printed in verbose mode + only. + +nxagent-3.1.0-5 + +- Moved some variable definitions placed in ProcGetProperty(). + +nxagent-3.1.0-4 + +- Fixed TR06D01397. The problem was: drag & drop operations between + windows of Java applications didn't work in NX Client for Windows. + +- Implemented FR12E01957. Added a limit to the amount of data that can + be pasted from an NX session into an external application. The new + option - named 'copysize' - can be read from the 'options' file. + +nxagent-3.1.0-3 + +- Fixed TR12E01963. The window tree is revalidated explicitly after + recomputing the root window clip regions. + nxagent-3.1.0-2 - Fixed TR11E01946. Forcing exposures on regions saved in the backing diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index b581540cb..4d8f3f631 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -59,7 +59,7 @@ static int agentClipboardStatus; static int clientAccum; Atom serverCutProperty; -static Atom clientCutProperty; +Atom clientCutProperty; static Window serverWindow; static const int nxagentPrimarySelection = 0; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index 89cc1a846..1644d51a4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -650,6 +650,22 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned { w = MIN(box.x2 - x, tileWidth); + /* + * FIXME: This should not occur. + */ + + 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; + } + if (canBreakOnTimeout(breakMask)) { /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index e1eab6fd2..d2d9f87ea 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -55,6 +55,7 @@ #include "Drawable.h" #include "Handlers.h" #include "Utils.h" +#include "Error.h" #include "NX.h" #include "NXvars.h" @@ -1478,7 +1479,10 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) if (nxagentExposeQueue.exposures[nxagentExposeQueue.start].serial != X.xconfigure.x) { #ifdef WARNING - fprintf(stderr, "nxagentDispatchEvents: Requested ConfigureNotify changes didn't take place.\n"); + if (nxagentVerbose == 1) + { + fprintf(stderr, "nxagentDispatchEvents: Requested ConfigureNotify changes didn't take place.\n"); + } #endif } @@ -3358,7 +3362,8 @@ void nxagentSynchronizeExpose(void) (nxagentExposeQueueHead.remoteRegion), (nxagentExposeQueueHead.localRegion)); - if (REGION_NIL(nxagentExposeQueueHead.remoteRegion) == 0) + if (REGION_NIL(nxagentExposeQueueHead.remoteRegion) == 0 && + ((pWin -> eventMask|wOtherEventMasks(pWin)) & ExposureMask)) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeExpose: Going to call miWindowExposures" diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c index 3a27e0da0..64dbe3b42 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c @@ -139,6 +139,8 @@ void nxagentInitOptions() nxagentOptions.ClientOs = UNDEFINED; nxagentOptions.InhibitXkb = 1; + + nxagentOptions.CopyBufferSize = COPY_UNLIMITED; } /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.h b/nx-X11/programs/Xserver/hw/nxagent/Options.h index 493ba6f61..aa78489b1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.h @@ -27,6 +27,7 @@ #endif #define UNDEFINED -1 +#define COPY_UNLIMITED -1 typedef enum _BackingStoreMode { @@ -349,6 +350,13 @@ typedef struct _AgentOptions int InhibitXkb; + /* + * Maximum number of bytes that can be pasted from + * an NX session into an external application. + */ + + int CopyBufferSize; + } AgentOptionsRec; typedef AgentOptionsRec *AgentOptionsPtr; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 255da3362..4cc1075af 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -46,6 +46,7 @@ is" without express or implied warranty. #include "../../fb/fb.h" #include "../../randr/randrstr.h" #include "inputstr.h" +#include "mivalidate.h" #include "Agent.h" #include "Display.h" @@ -1989,6 +1990,144 @@ Bool nxagentCloseScreen(int index, ScreenPtr pScreen) return True; } +/* + * This function comes from the xfree86 Xserver. + */ + +static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable) +{ + WindowPtr pWin = WindowTable[pScreen->myNum]; + WindowPtr pChild; + Bool WasViewable = (Bool)(pWin->viewable); + Bool anyMarked = FALSE; + RegionPtr pOldClip = NULL, bsExposed; +#ifdef DO_SAVE_UNDERS + Bool dosave = FALSE; +#endif + WindowPtr pLayerWin; + BoxRec box; + + if (WasViewable) + { + for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) + { + (void) (*pScreen->MarkOverlappedWindows)(pChild, + pChild, + &pLayerWin); + } + (*pScreen->MarkWindow) (pWin); + anyMarked = TRUE; + if (pWin->valdata) + { + if (HasBorder (pWin)) + { + RegionPtr borderVisible; + + borderVisible = REGION_CREATE(pScreen, NullBox, 1); + REGION_SUBTRACT(pScreen, borderVisible, + &pWin->borderClip, &pWin->winSize); + pWin->valdata->before.borderVisible = borderVisible; + } + pWin->valdata->before.resized = TRUE; + } + } + + /* + * Use REGION_BREAK to avoid optimizations in ValidateTree + * that assume the root borderClip can't change well, normally + * it doesn't...) + */ + if (enable) + { + box.x1 = 0; + box.y1 = 0; + box.x2 = pScreen->width; + box.y2 = pScreen->height; + REGION_INIT (pScreen, &pWin->winSize, &box, 1); + REGION_INIT (pScreen, &pWin->borderSize, &box, 1); + if (WasViewable) + REGION_RESET(pScreen, &pWin->borderClip, &box); + pWin->drawable.width = pScreen->width; + pWin->drawable.height = pScreen->height; + REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList); + } + else + { + REGION_EMPTY(pScreen, &pWin->borderClip); + REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList); + } + + ResizeChildrenWinSize (pWin, 0, 0, 0, 0); + + if (WasViewable) + { + if (pWin->backStorage) + { + pOldClip = REGION_CREATE(pScreen, NullBox, 1); + REGION_COPY(pScreen, pOldClip, &pWin->clipList); + } + + if (pWin->firstChild) + { + anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild, + pWin->firstChild, + (WindowPtr *)NULL); + } + else + { + (*pScreen->MarkWindow) (pWin); + anyMarked = TRUE; + } + +#ifdef DO_SAVE_UNDERS + if (DO_SAVE_UNDERS(pWin)) + { + dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin); + } +#endif /* DO_SAVE_UNDERS */ + + if (anyMarked) + (*pScreen->ValidateTree)(pWin, NullWindow, VTOther); + } + + if (pWin->backStorage && + ((pWin->backingStore == Always) || WasViewable)) + { + if (!WasViewable) + pOldClip = &pWin->clipList; /* a convenient empty region */ + bsExposed = (*pScreen->TranslateBackingStore) + (pWin, 0, 0, pOldClip, + pWin->drawable.x, pWin->drawable.y); + if (WasViewable) + REGION_DESTROY(pScreen, pOldClip); + if (bsExposed) + { + RegionPtr valExposed = NullRegion; + + if (pWin->valdata) + valExposed = &pWin->valdata->after.exposed; + (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); + if (valExposed) + REGION_EMPTY(pScreen, valExposed); + REGION_DESTROY(pScreen, bsExposed); + } + } + if (WasViewable) + { + if (anyMarked) + (*pScreen->HandleExposures)(pWin); +#ifdef DO_SAVE_UNDERS + if (dosave) + (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin); +#endif /* DO_SAVE_UNDERS */ + if (anyMarked && pScreen->PostValidateTree) + (*pScreen->PostValidateTree)(pWin, NullWindow, VTOther); + } + if (pWin->realized) + WindowsRestructured (); + FlushAllOutput (); +} + Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height, int mmWidth, int mmHeight) { @@ -2002,7 +2141,6 @@ Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height, int oldMmWidth; int oldMmHeight; - WindowPtr pWin; RegionPtr pRootWinSize; #ifdef TEST @@ -2180,25 +2318,7 @@ FIXME: We should try to restore the previously pRootWinSize = &WindowTable[pScreen -> myNum] -> winSize; - /* - * Force a fictitious resize of all the top - * level windows, in order to trigger the - * window tree validation. - */ - - if (nxagentOption(Rootless) == 0) - { - for (pWin = WindowTable[pScreen -> myNum] -> firstChild; pWin != NULL; pWin = pWin -> nextSib) - { - - (*pWin -> drawable.pScreen -> ResizeWindow)(pWin, pWin -> drawable.x, - pWin -> drawable.y, - pWin -> drawable.width, - pWin -> drawable.height, - pWin -> nextSib); - - } - } + nxagentSetRootClip(pScreen, 1); XMoveWindow(nxagentDisplay, nxagentWindow(WindowTable[0]), nxagentOption(RootX), nxagentOption(RootY)); diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c index 3d08a3228..f58163488 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c @@ -89,6 +89,7 @@ SOFTWARE. #include "Options.h" #include "Rootless.h" #include "Client.h" +#include "Windows.h" #if defined(LBX) || defined(LBX_COMPAT) #if 0 /* no header in X11 environment, not used in X11 environment */ @@ -99,6 +100,17 @@ int fWriteToClient(ClientPtr client, int len, char *buf) #endif #endif +extern Atom clientCutProperty; + +#ifdef NXAGENT_SERVER +typedef struct +{ + CARD32 state; + Window icon; +} +nxagentWMStateRec; +#endif + /***************************************************************** * Property Stuff * @@ -343,10 +355,23 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, int sizeInBytes; int totalSize; pointer data; + int copySize; sizeInBytes = format>>3; totalSize = len * sizeInBytes; + copySize = nxagentOption(CopyBufferSize); + + if (copySize != COPY_UNLIMITED && property == clientCutProperty) + { + if (totalSize > copySize) + { + totalSize = copySize; + totalSize = totalSize - (totalSize % sizeInBytes); + len = totalSize / sizeInBytes; + } + } + /* first see if property already exists */ pProp = wUserProps (pWin); @@ -545,6 +570,11 @@ NullPropertyReply( int ProcGetProperty(ClientPtr client) { + #ifdef NXAGENT_SERVER + nxagentWMStateRec wmState; + nxagentWMStateRec *wmsP = &wmState; + #endif + PropertyPtr pProp, prevProp; unsigned long n, len, ind; WindowPtr pWin; @@ -552,6 +582,7 @@ ProcGetProperty(ClientPtr client) REQUEST(xGetPropertyReq); REQUEST_SIZE_MATCH(xGetPropertyReq); + if (stuff->delete) UpdateCurrentTime(); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, @@ -587,6 +618,59 @@ ProcGetProperty(ClientPtr client) reply.type = X_Reply; reply.sequenceNumber = client->sequence; + + #ifdef NXAGENT_SERVER + + /* + * Creating a reply for WM_STATE property if it doesn't exist. + * This is intended to allow drag & drop work in JAva 1.6 when + * the agent is connected to NXWin in multiwindow mode. + */ + + if (nxagentOption(Rootless) && + nxagentWindowTopLevel(pWin) && + (!pProp) && + strcmp(NameForAtom(stuff->property), "WM_STATE") == 0) + { + wmState.state = 1; + wmState.icon = None; + + if (ChangeWindowProperty(pWin, stuff->property, stuff->property, 32, 0, 2, &wmState, 1) == Success) + { + nxagentExportProperty(pWin, stuff->property, stuff->property, 32, 0, 2, &wmState); + } + + n = 8; + ind = stuff->longOffset << 2; + + if (n < ind) + { + client->errorValue = stuff->longOffset; + return BadValue; + } + + len = min(n - ind, 4 * stuff->longLength); + + reply.bytesAfter = n - (ind + len); + reply.length = (len + 3) >> 2; + + reply.format = 32; + reply.nItems = len / 4; + reply.propertyType = stuff->property; + + WriteReplyToClient(client, sizeof(xGenericReply), &reply); + + if (len) + { + client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write; + + WriteSwappedDataToClient(client, len, (char *)wmsP + ind); + } + + return(client->noClientException); + } + #endif + if (!pProp) return NullPropertyReply(client, None, 0, &reply); diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.NX.original index 3d08a3228..f58163488 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.NX.original @@ -89,6 +89,7 @@ SOFTWARE. #include "Options.h" #include "Rootless.h" #include "Client.h" +#include "Windows.h" #if defined(LBX) || defined(LBX_COMPAT) #if 0 /* no header in X11 environment, not used in X11 environment */ @@ -99,6 +100,17 @@ int fWriteToClient(ClientPtr client, int len, char *buf) #endif #endif +extern Atom clientCutProperty; + +#ifdef NXAGENT_SERVER +typedef struct +{ + CARD32 state; + Window icon; +} +nxagentWMStateRec; +#endif + /***************************************************************** * Property Stuff * @@ -343,10 +355,23 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, int sizeInBytes; int totalSize; pointer data; + int copySize; sizeInBytes = format>>3; totalSize = len * sizeInBytes; + copySize = nxagentOption(CopyBufferSize); + + if (copySize != COPY_UNLIMITED && property == clientCutProperty) + { + if (totalSize > copySize) + { + totalSize = copySize; + totalSize = totalSize - (totalSize % sizeInBytes); + len = totalSize / sizeInBytes; + } + } + /* first see if property already exists */ pProp = wUserProps (pWin); @@ -545,6 +570,11 @@ NullPropertyReply( int ProcGetProperty(ClientPtr client) { + #ifdef NXAGENT_SERVER + nxagentWMStateRec wmState; + nxagentWMStateRec *wmsP = &wmState; + #endif + PropertyPtr pProp, prevProp; unsigned long n, len, ind; WindowPtr pWin; @@ -552,6 +582,7 @@ ProcGetProperty(ClientPtr client) REQUEST(xGetPropertyReq); REQUEST_SIZE_MATCH(xGetPropertyReq); + if (stuff->delete) UpdateCurrentTime(); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, @@ -587,6 +618,59 @@ ProcGetProperty(ClientPtr client) reply.type = X_Reply; reply.sequenceNumber = client->sequence; + + #ifdef NXAGENT_SERVER + + /* + * Creating a reply for WM_STATE property if it doesn't exist. + * This is intended to allow drag & drop work in JAva 1.6 when + * the agent is connected to NXWin in multiwindow mode. + */ + + if (nxagentOption(Rootless) && + nxagentWindowTopLevel(pWin) && + (!pProp) && + strcmp(NameForAtom(stuff->property), "WM_STATE") == 0) + { + wmState.state = 1; + wmState.icon = None; + + if (ChangeWindowProperty(pWin, stuff->property, stuff->property, 32, 0, 2, &wmState, 1) == Success) + { + nxagentExportProperty(pWin, stuff->property, stuff->property, 32, 0, 2, &wmState); + } + + n = 8; + ind = stuff->longOffset << 2; + + if (n < ind) + { + client->errorValue = stuff->longOffset; + return BadValue; + } + + len = min(n - ind, 4 * stuff->longLength); + + reply.bytesAfter = n - (ind + len); + reply.length = (len + 3) >> 2; + + reply.format = 32; + reply.nItems = len / 4; + reply.propertyType = stuff->property; + + WriteReplyToClient(client, sizeof(xGenericReply), &reply); + + if (len) + { + client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write; + + WriteSwappedDataToClient(client, len, (char *)wmsP + ind); + } + + return(client->noClientException); + } + #endif + if (!pProp) return NullPropertyReply(client, None, 0, &reply); |