aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-05-22 22:22:36 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-06-11 11:32:55 +0200
commitfd84270023d72fbe335d8586d128a113b942137c (patch)
tree04d0c046657e1e2158506854451bc440ed7cabd6
parent126cbe1ff20e19cd477c5fe9a127298bd12e3e2e (diff)
downloadnx-libs-fd84270023d72fbe335d8586d128a113b942137c.tar.gz
nx-libs-fd84270023d72fbe335d8586d128a113b942137c.tar.bz2
nx-libs-fd84270023d72fbe335d8586d128a113b942137c.zip
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.
-rw-r--r--nx-X11/programs/Xserver/dix/events.c4
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXevents.c141
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)