aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-06-13 01:56:07 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-06-21 04:06:27 +0200
commit04d2fe3aef464560de16d5b15ed91f8d63c6fb09 (patch)
tree432e42041ba0311eb07dbe838cf9b8ebe943d002 /nx-X11/programs/Xserver/hw
parent129cc6afd4ac49b458659ae8bb0d5201942c2aab (diff)
downloadnx-libs-04d2fe3aef464560de16d5b15ed91f8d63c6fb09.tar.gz
nx-libs-04d2fe3aef464560de16d5b15ed91f8d63c6fb09.tar.bz2
nx-libs-04d2fe3aef464560de16d5b15ed91f8d63c6fb09.zip
nxagentReversePointerMap: Don't assume Xevent.xbutton.button is always greater than zero. We have seen Xevent.xbutton.button being set to AnyButton (equaling 0).
Fixes ArcticaProject/nx-libs#92 Fixes X2GoBTS#791
Diffstat (limited to 'nx-X11/programs/Xserver/hw')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Events.c4
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Pointer.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c
index ffb593750..0a6540fa3 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Events.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c
@@ -1252,7 +1252,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
X.xbutton.subwindow == None))
{
x.u.u.type = ButtonPress;
- x.u.u.detail = inputInfo.pointer -> button -> map[nxagentReversePointerMap[X.xbutton.button - 1]];
+ x.u.u.detail = inputInfo.pointer -> button -> map[nxagentReversePointerMap[X.xbutton.button]];
x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis();
if (nxagentOption(Rootless))
@@ -1325,7 +1325,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
if (minimize != True)
{
x.u.u.type = ButtonRelease;
- x.u.u.detail = inputInfo.pointer -> button -> map[nxagentReversePointerMap[X.xbutton.button - 1]];
+ x.u.u.detail = inputInfo.pointer -> button -> map[nxagentReversePointerMap[X.xbutton.button]];
x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis();
if (nxagentOption(Rootless))
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c
index ce2b37a90..8a8ed85b1 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c
@@ -186,6 +186,6 @@ void nxagentInitPointerMap(void)
for (i = 1; i <= numButtons; i++)
{
- nxagentReversePointerMap[pointerMap[i - 1] - 1] = i;
+ nxagentReversePointerMap[pointerMap[i - 1]] = i;
}
}