aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Pointer.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-01-05 22:46:24 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-01-05 22:46:24 +0100
commita261b72435d7d30dbe36529a51fc53f6ade34dff (patch)
treefde666b59abbe3bdf0ed574147344c0d25075b03 /nx-X11/programs/Xserver/hw/nxagent/Pointer.c
parent0e2b7479cd4567128fbcd975e5376744d78cd416 (diff)
parentadca0cc92abed6f7f6184b91d807a4befb80e856 (diff)
downloadnx-libs-a261b72435d7d30dbe36529a51fc53f6ade34dff.tar.gz
nx-libs-a261b72435d7d30dbe36529a51fc53f6ade34dff.tar.bz2
nx-libs-a261b72435d7d30dbe36529a51fc53f6ade34dff.zip
Merge branch 'uli42-pr/code_cleanup' into 3.6.x
Attributes GH PR #869: https://github.com/ArcticaProject/nx-libs/pull/869
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Pointer.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Pointer.c35
1 files changed, 14 insertions, 21 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c
index d344f34b0..379a19fa0 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c
@@ -66,8 +66,8 @@ is" without express or implied warranty.
#undef DEBUG
/*
- * The nxagentReversePointerMap array is used to
- * memorize remote display pointer map.
+ * The nxagentReversePointerMap array is used to memorize remote
+ * display pointer map.
*/
unsigned char nxagentReversePointerMap[MAXBUTTONS];
@@ -76,13 +76,12 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl)
{
/*
* The original behaviour was to reset the pointer settings
- * (acceleration and alas) to the default values. What the
- * average user expects, on the contrary, is to have agent
- * inheriting whatever value is set on the real X display.
- * Having to reflect changes made inside the agent session,
- * the correct behavior would be saving the original values
- * and restoring them as soon as focus leaves the agent's
- * window.
+ * (acceleration and alas) to the default values. What the average
+ * user expects, on the contrary, is to have agent inheriting
+ * whatever value is set on the real X display. Having to reflect
+ * changes made inside the agent session, the correct behavior would
+ * be saving the original values and restoring them as soon as focus
+ * leaves the agent's window.
*/
if (nxagentOption(DeviceControl) == True)
@@ -104,10 +103,6 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl)
int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
{
- CARD8 map[MAXBUTTONS];
- int nmap;
- int i;
-
switch (onoff)
{
case DEVICE_INIT:
@@ -121,8 +116,10 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
return Success;
}
- nmap = XGetPointerMapping(nxagentDisplay, map, MAXBUTTONS);
- for (i = 0; i <= nmap; i++)
+ CARD8 map[MAXBUTTONS];
+
+ int nmap = XGetPointerMapping(nxagentDisplay, map, MAXBUTTONS);
+ for (int i = 0; i <= nmap; i++)
map[i] = i; /* buttons are already mapped */
InitPointerDeviceStruct((DevicePtr) pDev, map, nmap,
miPointerGetMotionEvents,
@@ -174,10 +171,6 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
void nxagentInitPointerMap(void)
{
- int numButtons;
-
- int i;
-
unsigned char pointerMap[MAXBUTTONS];
#ifdef DEBUG
@@ -185,13 +178,13 @@ void nxagentInitPointerMap(void)
"pointer map from remote display.\n");
#endif
- numButtons = XGetPointerMapping(nxagentDisplay, pointerMap, MAXBUTTONS);
+ int numButtons = XGetPointerMapping(nxagentDisplay, pointerMap, MAXBUTTONS);
/*
* Computing revers pointer map.
*/
- for (i = 1; i <= numButtons; i++)
+ for (int i = 1; i <= numButtons; i++)
{
nxagentReversePointerMap[pointerMap[i - 1]] = i;
}