Commit fdaa2404 authored by Mike Gabriel's avatar Mike Gabriel

Merge branch 'nxagent'

parents fe72988f 222a4a22
......@@ -514,6 +514,22 @@ int ddxProcessArgument(int argc, char *argv[], int i)
return 0;
}
if (!strcmp(argv[i], "-irlimit"))
{
int limit;
if (++i < argc &&
sscanf(argv[i], "%i", &limit) == 1)
{
nxagentChangeOption(ImageRateLimit, limit);
return 2;
}
return 0;
}
if (!strcmp(argv[i], "-tile"))
{
int width;
......@@ -780,6 +796,8 @@ int ddxProcessArgument(int argc, char *argv[], int i)
{
nxagentChangeOption(DeviceControl, True);
nxagentChangeOption(DeviceControlUserDefined , True);
return 1;
}
......
ChangeLog:
nxagent-3.5.0-9
- Fixed an issue with cursor position set in XTest extension.
nxagent-3.5.0-8
- Fixed TR01J02646. Performance issues with cairo version 1.12.
- Fixed TR01J02667. Changes to mouse sensitivity couldn't be forwarded
to NX client host although -noignore was among extra options.
- Fixed TR05J02705. Agent ignore WarpPointer requests.
- Fixed TR05J02706. Suspended sessions could not be recovered using
a client form a different version.
- Fixed TR05J02703. Agent failed because of missing checks on source
drawables in the render code.
nxagent-3.5.0-7
- Fixed TR10I02622. Corrected function searching for icon file.
......
......@@ -124,13 +124,24 @@ void nxagentGuessClientHint(ClientPtr client, Atom property, char *data)
if (nxagentClientPriv(client) -> clientHint == UNKNOWN)
{
if (property == XA_WM_CLASS && strcmp(data, "nxclient") == 0)
if (property == XA_WM_CLASS)
{
#ifdef TEST
fprintf(stderr, "++++++nxagentGuessClientHint: Detected nxclient as [%d].\n", client -> index);
#endif
if (strcmp(data, "nxclient") == 0)
{
#ifdef TEST
fprintf(stderr, "++++++nxagentGuessClientHint: Detected nxclient as [%d].\n", client -> index);
#endif
nxagentClientHint(client) = NXCLIENT_WINDOW;
nxagentClientHint(client) = NXCLIENT_WINDOW;
}
else if (strstr(data, "java"))
{
#ifdef TEST
fprintf(stderr, "++++++nxagentGuessClientHint: Detected java as [%d].\n", client -> index);
#endif
nxagentClientHint(client) = JAVA_WINDOW;
}
}
}
......
......@@ -32,7 +32,8 @@ enum ClientHint
UNKNOWN = 0,
NXCLIENT_WINDOW,
NXCLIENT_DIALOG,
NXAGENT_SHADOW
NXAGENT_SHADOW,
JAVA_WINDOW
};
typedef struct _PrivClientRec
......
......@@ -290,10 +290,25 @@ void nxagentRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor,
&fg_color, &bg_color);
}
Bool (*nxagentSetCursorPositionW)(ScreenPtr pScreen, int x, int y,
Bool generateEvent);
Bool nxagentSetCursorPosition(ScreenPtr pScreen, int x, int y,
Bool generateEvent)
{
return 1;
if (generateEvent != 0)
{
return (*nxagentSetCursorPositionW)(pScreen, x, y, generateEvent);
}
else
{
/*
* Calling miSetCursorPosition with generateEvent == 0
* causes a crash in miPoiterUpdate().
*/
return 1;
}
}
void nxagentReconnectCursor(pointer p0, XID x1, pointer p2)
......
......@@ -97,6 +97,9 @@ void nxagentRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor,
Bool nxagentSetCursorPosition(ScreenPtr pScreen, int x, int y,
Bool generateEvent);
extern Bool (*nxagentSetCursorPositionW)(ScreenPtr pScreen, int x, int y,
Bool generateEvent);
void nxagentDisconnectCursor(pointer p0, XID x1, pointer p2);
void nxagentReconnectCursor(pointer p0, XID x1, pointer p2);
void nxagentReDisplayCurrentCursor(void);
......
......@@ -746,8 +746,19 @@ static void nxagentDisplayWriteHandler(Display *display, int length)
}
}
static CARD32 nxagentRateTime = 5000;
static CARD32 nxagentLastTime;
static unsigned int nxagentRate = 0;
int nxagentGetDataRate(void)
{
return nxagentRate;
}
static void nxagentDisplayFlushHandler(Display *display, int length)
{
CARD32 time;
if (nxagentDisplay != NULL)
{
#ifdef TEST
......@@ -765,6 +776,22 @@ static void nxagentDisplayFlushHandler(Display *display, int length)
if (nxagentOption(LinkType) != LINK_TYPE_NONE)
{
nxagentFlush = GetTimeInMillis();
time = nxagentFlush;
time = time - nxagentLastTime;
if (time < nxagentRateTime)
{
nxagentRate = ((nxagentRate * (nxagentRateTime - time) +
length) * 1000) / nxagentRateTime;
}
else
{
nxagentRate = (length * 1000) / nxagentRateTime;
}
nxagentLastTime = nxagentFlush;
}
}
}
......@@ -1482,10 +1509,6 @@ void nxagentSetDefaultVisual(void)
int i;
nxagentDefaultVisualIndex = 3;
return;
if (nxagentUserDefaultClass || nxagentUserDefaultDepth)
{
nxagentDefaultVisualIndex = UNDEFINED;
......
......@@ -159,6 +159,8 @@ extern int nxagentShadowXConnectionNumber;
int nxagentServerOrder(void);
int nxagentGetDataRate(void);
#define nxagentClientOrder(client) \
((client)->swapped ? !nxagentServerOrder() : nxagentServerOrder())
......
......@@ -112,6 +112,27 @@ unsigned long nxagentGetColor(DrawablePtr pDrawable, int xPixel, int yPixel);
unsigned long nxagentGetDrawableColor(DrawablePtr pDrawable);
unsigned long nxagentGetRegionColor(DrawablePtr pDrawable, RegionPtr pRegion);
int nxagentSkipImage = 0;
static int nxagentTooManyImageData(void)
{
unsigned int r;
unsigned int limit;
limit = nxagentOption(ImageRateLimit);
r = nxagentGetDataRate() / 1000;
#ifdef TEST
if (r > limit)
{
fprintf(stderr, "Warning: Current bit rate is: %u kB/s.\n", r);
}
#endif
return (r > limit);
}
int nxagentSynchronizeDrawable(DrawablePtr pDrawable, int wait, unsigned int breakMask, WindowPtr owner)
{
int result;
......@@ -1304,6 +1325,18 @@ FIXME: All drawables should be set as synchronized and
never marked as corrupted while the display is
down.
*/
nxagentSkipImage = nxagentTooManyImageData();
if (nxagentOption(ImageRateLimit) && nxagentSkipImage)
{
#ifdef TEST
fprintf(stderr, "nxagentSynchronizeDrawable: Skipping due to bit rate limit reached.\n");
#endif
return;
}
if (NXDisplayError(nxagentDisplay) == 1)
{
#ifdef TEST
......
......@@ -159,6 +159,8 @@ struct _DispatchRec nxagentDispatch = { UNDEFINED, 0, 0, 0 };
* for our clients or the X server.
*/
extern int nxagentSkipImage;
void nxagentBlockHandler(pointer data, struct timeval **timeout, pointer mask)
{
/*
......@@ -357,7 +359,7 @@ void nxagentBlockHandler(pointer data, struct timeval **timeout, pointer mask)
nxagentCorruptedBackgrounds > 0 ||
nxagentCorruptedPixmaps > 0));
if (synchronize == 1)
if (nxagentSkipImage == 0 && synchronize == 1)
{
#ifdef TEST
fprintf(stderr, "nxagentBlockHandler: Setting a zero timeout with [%d][%d][%d] and "
......
......@@ -120,6 +120,8 @@ extern int OsVendorVErrorFFatal;
extern void (*OsVendorStartRedirectErrorFProc)();
extern void (*OsVendorEndRedirectErrorFProc)();
extern void SetVendorRelease(int release);
void OsVendorStartRedirectErrorFFunction();
void OsVendorEndRedirectErrorFFunction();
......@@ -206,6 +208,22 @@ void InitOutput(ScreenInfo *screenInfo, int argc, char *argv[])
}
/*
* Avoid slowness due to buggy_repeat workaround
* in libcairo versions >= 1.10.
*/
SetVendorRelease(70000000);
/*
* Init the time count for image rate.
*/
if (nxagentOption(ImageRateLimit) != 0)
{
fprintf(stderr, "Info: Image rate limit set to %u kB/s.\n", nxagentOption(ImageRateLimit));
}
/*
* Unset the LD_LIBRARY_PATH variable in
* Popen() before calling execl() in the
* child process.
......
......@@ -85,6 +85,8 @@ void nxagentInitOptions()
nxagentOptions.DeviceControl = 0;
nxagentOptions.DeviceControlUserDefined = 0;
nxagentOptions.ResetKeyboardAtResume = 1;
nxagentOptions.Reset = 0;
......@@ -149,6 +151,8 @@ void nxagentInitOptions()
nxagentOptions.InhibitXkb = 1;
nxagentOptions.CopyBufferSize = COPY_UNLIMITED;
nxagentOptions.ImageRateLimit = 0;
}
/*
......
......@@ -184,6 +184,12 @@ typedef struct _AgentOptions
int DeviceControl;
/*
* Explicitly asked config propagation.
*/
int DeviceControlUserDefined;
/*
* Resuming keyboard device corrects keymap if session
* migrates across platforms with different keycode
* layout.
......@@ -369,6 +375,12 @@ typedef struct _AgentOptions
int CopyBufferSize;
/*
* Max image data rate to the encoder input.
*/
int ImageRateLimit;
} AgentOptionsRec;
typedef AgentOptionsRec *AgentOptionsPtr;
......
......@@ -134,7 +134,7 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE
(nxagentOption(DeferLevel) == 1 && \
(pDst) -> pDrawable -> type == DRAWABLE_PIXMAP && \
(((pSrc) -> pDrawable && nxagentDrawableStatus((pSrc) -> pDrawable) == NotSynchronized) || \
((pMask) && nxagentDrawableStatus((pMask) -> pDrawable) == NotSynchronized))))
((pMask) && (pMask) -> pDrawable && nxagentDrawableStatus((pMask) -> pDrawable) == NotSynchronized))))
#define NXAGENT_SHOULD_DEFER_PUTIMAGE(pDrawable) \
......
......@@ -377,11 +377,10 @@ Bool nxagentReconnectSession(void)
nxagentResizeDesktopAtStartup = False;
/*
* The default is device settings have
* not to be propagated to the X server.
* Propagate device settings if explicitly asked for.
*/
nxagentChangeOption(DeviceControl, False);
nxagentChangeOption(DeviceControl, nxagentOption(DeviceControlUserDefined));
/*
* We need to zero out every new XID
......
......@@ -1095,8 +1095,9 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD
}
}
if (pMask != NULL && pMask -> pDrawable != pSrc -> pDrawable &&
pMask -> pDrawable != pDst -> pDrawable)
if (pMask != NULL && pMask -> pDrawable != NULL &&
pMask -> pDrawable != pSrc -> pDrawable &&
pMask -> pDrawable != pDst -> pDrawable)
{
nxagentSynchronizeShmPixmap(pMask -> pDrawable, xMask, yMask, width, height);
......@@ -1259,7 +1260,8 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
* on the real X server.
*/
if (nxagentDrawableStatus(pSrc -> pDrawable) == NotSynchronized)
if (pSrc -> pDrawable != NULL &&
nxagentDrawableStatus(pSrc -> pDrawable) == NotSynchronized)
{
#ifdef TEST
fprintf(stderr, "nxagentGlyphs: Synchronizing source [%s] at [%p].\n",
......@@ -1749,7 +1751,8 @@ FIXME: Is this useful or just a waste of bandwidth?
return;
}
if (nxagentDrawableStatus(pSrc -> pDrawable) == NotSynchronized)
if (pSrc -> pDrawable != NULL &&
nxagentDrawableStatus(pSrc -> pDrawable) == NotSynchronized)
{
#ifdef TEST
fprintf(stderr, "nxagentTrapezoids: Going to synchronize the source drawable at [%p].\n",
......@@ -1843,7 +1846,8 @@ void nxagentTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
* operation like nxagentTrapezoids() does.
*/
if (nxagentDrawableStatus(pSrc -> pDrawable) == NotSynchronized)
if (pSrc -> pDrawable != NULL &&
nxagentDrawableStatus(pSrc -> pDrawable) == NotSynchronized)
{
#ifdef TEST
fprintf(stderr, "nxagentTriangles: Going to synchronize the source drawable at [%p].\n",
......@@ -1920,7 +1924,8 @@ void nxagentTriStrip(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
* operation like nxagentTrapezoids() does.
*/
if (nxagentDrawableStatus(pSrc -> pDrawable) == NotSynchronized)
if (pSrc -> pDrawable != NULL &&
nxagentDrawableStatus(pSrc -> pDrawable) == NotSynchronized)
{
#ifdef TEST
fprintf(stderr, "nxagentTriStrip: Going to synchronize the source drawable at [%p].\n",
......@@ -1997,7 +2002,8 @@ void nxagentTriFan(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
* operation like nxagentTrapezoids() does.
*/
if (nxagentDrawableStatus(pSrc -> pDrawable) == NotSynchronized)
if (pSrc -> pDrawable != NULL &&
nxagentDrawableStatus(pSrc -> pDrawable) == NotSynchronized)
{
#ifdef TEST
fprintf(stderr, "nxagentTriFan: Going to synchronize the source drawable at [%p].\n",
......
......@@ -1644,6 +1644,9 @@ N/A
pScreen->RealizeCursor = nxagentRealizeCursor;
pScreen->UnrealizeCursor = nxagentUnrealizeCursor;
pScreen->RecolorCursor = nxagentRecolorCursor;
nxagentSetCursorPositionW = pScreen->SetCursorPosition;
pScreen->SetCursorPosition = nxagentSetCursorPosition;
#define POSITION_OFFSET (pScreen->myNum * (nxagentOption(Width) + \
......
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