aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Pointer.c
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2011-10-10 17:58:59 +0200
committerReinhard Tartler <siretart@tauware.de>2011-10-10 17:58:59 +0200
commitb7494f082ad56049c24927afdf89abc852fe06bb (patch)
tree332640e859cbc9711ed183fe1e86895d1d945ca5 /nx-X11/programs/Xserver/hw/nxagent/Pointer.c
parentc078024019d334eb96fbfaf922c64297c9a0c6e0 (diff)
downloadnx-libs-b7494f082ad56049c24927afdf89abc852fe06bb.tar.gz
nx-libs-b7494f082ad56049c24927afdf89abc852fe06bb.tar.bz2
nx-libs-b7494f082ad56049c24927afdf89abc852fe06bb.zip
Imported nxagent-3.4.0-8.tar.gznxagent/3.4.0-8
Summary: Imported nxagent-3.4.0-8.tar.gz Keywords: Imported nxagent-3.4.0-8.tar.gz into Git repository
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Pointer.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Pointer.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c
index 34012d3d5..9c1bfaace 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c
@@ -57,6 +57,13 @@ is" without express or implied warranty.
#undef TEST
#undef DEBUG
+/*
+ * The nxagentReversePointerMap array is used to
+ * memorize remote display pointer map.
+ */
+
+unsigned char nxagentReversePointerMap[MAXBUTTONS];
+
void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl)
{
/*
@@ -125,6 +132,8 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
return Success;
}
+ nxagentInitPointerMap();
+
nxagentEnablePointerEvents();
break;
@@ -155,3 +164,28 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
return Success;
}
+
+void nxagentInitPointerMap(void)
+{
+ int numButtons;
+
+ int i;
+
+ unsigned char pointerMap[MAXBUTTONS];
+
+ #ifdef DEBUG
+ fprintf(stderr, "nxagentInitPointerMap: Going to retrieve the "
+ "pointer map from remote display.\n");
+ #endif
+
+ numButtons = XGetPointerMapping(nxagentDisplay, pointerMap, MAXBUTTONS);
+
+ /*
+ * Computing revers pointer map.
+ */
+
+ for (i = 1; i <= numButtons; i++)
+ {
+ nxagentReversePointerMap[pointerMap[i - 1] - 1] = i;
+ }
+}