Commit 5e17d05a authored by Mike Gabriel's avatar Mike Gabriel

nxagentReversePointerMap: Don't assume Xevent.xbutton.button is always greater…

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
parent 61d0fbea
......@@ -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))
......
......@@ -186,6 +186,6 @@ void nxagentInitPointerMap(void)
for (i = 1; i <= numButtons; i++)
{
nxagentReversePointerMap[pointerMap[i - 1] - 1] = i;
nxagentReversePointerMap[pointerMap[i - 1]] = i;
}
}
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