From fd84270023d72fbe335d8586d128a113b942137c Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 22 May 2019 22:22:36 +0200 Subject: Fix NXevents.c: Reactivate errornously commented function CheckMotion() had been commented in add881931f2e702fb1952f4e1baba04b3dc536ee as it looked identical to the version from dix/events.c except for some commented code. But this based (probably) on a thinko - code that had been disabled by NX became active again this way. Fix this by removing the comments and by adding #ifdef/else to emphasize the difference. --- nx-X11/programs/Xserver/dix/events.c | 4 + nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 141 ++++++++++++++------------ 2 files changed, 79 insertions(+), 66 deletions(-) diff --git a/nx-X11/programs/Xserver/dix/events.c b/nx-X11/programs/Xserver/dix/events.c index e936be77e..745932af3 100644 --- a/nx-X11/programs/Xserver/dix/events.c +++ b/nx-X11/programs/Xserver/dix/events.c @@ -245,6 +245,8 @@ static WindowPtr XYToWindow( int y ); +static Bool CheckMotion(xEvent *xE); + extern int lastEvent; static Mask lastEventMask; @@ -1951,6 +1953,7 @@ XYToWindow(int x, int y) } #endif /* NXAGENT_SERVER */ +#ifndef NXAGENT_SERVER static Bool CheckMotion(xEvent *xE) { @@ -2015,6 +2018,7 @@ CheckMotion(xEvent *xE) } return TRUE; } +#endif /* NXAGENT_SERVER */ void WindowsRestructured() diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c index 370fff6b5..43dfe8613 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c @@ -381,79 +381,88 @@ XYToWindow(int x, int y) return spriteTrace[spriteTraceGood-1]; } -// static Bool -// CheckMotion(xEvent *xE) -// { -// WindowPtr prevSpriteWin = sprite.win; -// +static Bool +CheckMotion(xEvent *xE) +{ + WindowPtr prevSpriteWin = sprite.win; + #ifdef PANORAMIX -// if(!noPanoramiXExtension) -// return XineramaCheckMotion(xE); + if(!noPanoramiXExtension) + return XineramaCheckMotion(xE); #endif -// if (xE && !syncEvents.playingEvents) -// { -// if (sprite.hot.pScreen != sprite.hotPhys.pScreen) -// { -// sprite.hot.pScreen = sprite.hotPhys.pScreen; -// ROOT = sprite.hot.pScreen->root; -// } -// sprite.hot.x = XE_KBPTR.rootX; -// sprite.hot.y = XE_KBPTR.rootY; -// if (sprite.hot.x < sprite.physLimits.x1) -// sprite.hot.x = sprite.physLimits.x1; -// else if (sprite.hot.x >= sprite.physLimits.x2) -// sprite.hot.x = sprite.physLimits.x2 - 1; -// if (sprite.hot.y < sprite.physLimits.y1) -// sprite.hot.y = sprite.physLimits.y1; -// else if (sprite.hot.y >= sprite.physLimits.y2) -// sprite.hot.y = sprite.physLimits.y2 - 1; + if (xE && !syncEvents.playingEvents) + { + if (sprite.hot.pScreen != sprite.hotPhys.pScreen) + { + sprite.hot.pScreen = sprite.hotPhys.pScreen; + ROOT = sprite.hot.pScreen->root; + } + sprite.hot.x = XE_KBPTR.rootX; + sprite.hot.y = XE_KBPTR.rootY; + if (sprite.hot.x < sprite.physLimits.x1) + sprite.hot.x = sprite.physLimits.x1; + else if (sprite.hot.x >= sprite.physLimits.x2) + sprite.hot.x = sprite.physLimits.x2 - 1; + if (sprite.hot.y < sprite.physLimits.y1) + sprite.hot.y = sprite.physLimits.y1; + else if (sprite.hot.y >= sprite.physLimits.y2) + sprite.hot.y = sprite.physLimits.y2 - 1; #ifdef SHAPE -// if (sprite.hotShape) -// ConfineToShape(sprite.hotShape, &sprite.hot.x, &sprite.hot.y); + if (sprite.hotShape) + ConfineToShape(sprite.hotShape, &sprite.hot.x, &sprite.hot.y); #endif -// sprite.hotPhys = sprite.hot; -// -// /* -// * This code force cursor position to be inside the -// * root window of the agent. We can't view a reason -// * to do this and it interacts in an undesirable way -// * with toggling fullscreen. -// * -// * if ((sprite.hotPhys.x != XE_KBPTR.rootX) || -// * (sprite.hotPhys.y != XE_KBPTR.rootY)) -// * { -// * (*sprite.hotPhys.pScreen->SetCursorPosition)( -// * sprite.hotPhys.pScreen, -// * sprite.hotPhys.x, sprite.hotPhys.y, FALSE); -// * } -// */ -// -// XE_KBPTR.rootX = sprite.hot.x; -// XE_KBPTR.rootY = sprite.hot.y; -// } -// -// sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y); + sprite.hotPhys = sprite.hot; + +#ifdef NXAGENT_SERVER + /* + * This code force cursor position to be inside the + * root window of the agent. We can't view a reason + * to do this and it interacts in an undesirable way + * with toggling fullscreen. + * + * if ((sprite.hotPhys.x != XE_KBPTR.rootX) || + * (sprite.hotPhys.y != XE_KBPTR.rootY)) + * { + * (*sprite.hotPhys.pScreen->SetCursorPosition)( + * sprite.hotPhys.pScreen, + * sprite.hotPhys.x, sprite.hotPhys.y, FALSE); + * } + */ +#else + if ((sprite.hotPhys.x != XE_KBPTR.rootX) || + (sprite.hotPhys.y != XE_KBPTR.rootY)) + { + (*sprite.hotPhys.pScreen->SetCursorPosition)( + sprite.hotPhys.pScreen, + sprite.hotPhys.x, sprite.hotPhys.y, FALSE); + } +#endif + XE_KBPTR.rootX = sprite.hot.x; + XE_KBPTR.rootY = sprite.hot.y; + } + + sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y); #ifdef notyet -// if (!(sprite.win->deliverableEvents & -// Motion_Filter(inputInfo.pointer->button)) -// !syncEvents.playingEvents) -// { -// /* XXX Do PointerNonInterestBox here */ -// } + if (!(sprite.win->deliverableEvents & + Motion_Filter(inputInfo.pointer->button)) + !syncEvents.playingEvents) + { + /* XXX Do PointerNonInterestBox here */ + } #endif -// if (sprite.win != prevSpriteWin) -// { -// if (prevSpriteWin != NullWindow) { -// if (!xE) -// UpdateCurrentTimeIf(); -// DoEnterLeaveEvents(prevSpriteWin, sprite.win, NotifyNormal); -// } -// PostNewCursor(); -// return FALSE; -// } -// return TRUE; -// } + if (sprite.win != prevSpriteWin) + { + if (prevSpriteWin != NullWindow) { + if (!xE) + UpdateCurrentTimeIf(); + DoEnterLeaveEvents(prevSpriteWin, sprite.win, NotifyNormal); + } + PostNewCursor(); + return FALSE; + } + return TRUE; +} void DefineInitialRootWindow(register WindowPtr win) -- cgit v1.2.3 From 49adb1e5ccf6cd5da186a6ca10bfb6e8048b4be4 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Thu, 23 May 2019 00:17:21 +0200 Subject: render/glyph.c: add missing usage_hint was missing in 8b5bb2cdafe5f7bd77826a1fd28f07b7329be899 --- nx-X11/programs/Xserver/render/glyph.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/render/glyph.c b/nx-X11/programs/Xserver/render/glyph.c index 9c9a485ea..a379b505f 100644 --- a/nx-X11/programs/Xserver/render/glyph.c +++ b/nx-X11/programs/Xserver/render/glyph.c @@ -589,7 +589,8 @@ miGlyphs(CARD8 op, height = extents.y2 - extents.y1; pMaskPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, - maskFormat->depth); + maskFormat->depth, + CREATE_PIXMAP_USAGE_SCRATCH); if (!pMaskPixmap) return; component_alpha = NeedsComponent(maskFormat->format); -- cgit v1.2.3 From a736122f5712d5d1b3b798ace3583a101c0cdf61 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Mon, 27 May 2019 15:42:11 +0200 Subject: os: fix BigReq ignoring when another request is pending Not sure how it came to this situation, but the following commit is partly contained in our version of the code. Some lines had not been removed, tough... commit c80c41767eb101e9dbd8393d8cca7764b4e248a4 Author: Aaron Plattner Date: Mon Oct 25 22:01:32 2010 -0700 os: Fix BigReq ignoring when another request is pending Commit cf88363db0ebb42df7cc286b85d30d7898aea840 fixed the handling of BigReq requests that are way too large and handles the case where the read() syscall returns a short read. However, it neglected to handle the case where it returns a long read, which happens when the client has another request in the queue after the bogus large one. Handle the long read case by subtracting the smaller of 'needed' and 'gotnow' from oci->ignoreBytes. If needed < gotnow, simply subtract the two, leaving gotnow equal to the number of extra bytes read. Since the code immediately following the (oci->ignoreBytes > 0) block tries to handle the next request, advance oci->bufptr immediately instead of setting oci->lenLastReq and letting the next call to ReadRequestFromClient do it. Fixes the XTS pChangeKeyboardMapping-3 test. CASES TESTS PASS UNSUP UNTST NOTIU WARN FIP FAIL UNRES UNIN ABORT -Xproto 122 389 367 2 19 0 0 0 1 0 0 0 +Xproto 122 389 368 2 19 0 0 0 0 0 0 0 Signed-off-by: Aaron Plattner Reviewed-by: Adam Jackson Signed-off-by: Keith Packard --- nx-X11/programs/Xserver/os/io.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/nx-X11/programs/Xserver/os/io.c b/nx-X11/programs/Xserver/os/io.c index ad1fdcd20..02a47f135 100644 --- a/nx-X11/programs/Xserver/os/io.c +++ b/nx-X11/programs/Xserver/os/io.c @@ -424,8 +424,6 @@ ReadRequestFromClient(ClientPtr client) if (oci->ignoreBytes > 0) { assert(needed == oci->ignoreBytes || needed == oci->size); - oci->ignoreBytes -= gotnow; - needed = gotnow = 0; /* * The _XSERVTransRead call above may return more or fewer bytes than we * want to ignore. Ignore the smaller of the two sizes. -- cgit v1.2.3