summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2023-02-15 10:53:01 +1000
committerOlivier Fourdan <fourdan@gmail.com>2023-02-16 10:25:16 +0000
commit6f0cd15155c59eb4f882345cbc31bfca5e73f324 (patch)
treeb072e3e44d32b8698eb16392e49edbd19696b9ed
parent462b06033e66a32308d940eb5fc47f5e4c914dc0 (diff)
downloadxserver-6f0cd15155c59eb4f882345cbc31bfca5e73f324.tar.gz
dix: remove pointless "flexible" x/y axis mapping
storeLastValuators() takes the index in the mask for the x and y axis. Completely pointless because any device that doesn't have x/y on 0 and 1, respectively, is going to break in fun ways anyway. And we only have two callers two this function, both of which hardcode 0 and 1. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--dix/getevents.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/dix/getevents.c b/dix/getevents.c
index 32bafe285..e9a73981f 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1247,19 +1247,18 @@ transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
}
static void
-storeLastValuators(DeviceIntPtr dev, ValuatorMask *mask,
- int xaxis, int yaxis, double devx, double devy)
+storeLastValuators(DeviceIntPtr dev, ValuatorMask *mask, double devx, double devy)
{
int i;
/* store desktop-wide in last.valuators */
- if (valuator_mask_isset(mask, xaxis))
+ if (valuator_mask_isset(mask, 0))
dev->last.valuators[0] = devx;
- if (valuator_mask_isset(mask, yaxis))
+ if (valuator_mask_isset(mask, 1))
dev->last.valuators[1] = devy;
for (i = 0; i < valuator_mask_size(mask); i++) {
- if (i == xaxis || i == yaxis)
+ if (i == 0 || i == 1)
continue;
if (valuator_mask_isset(mask, i))
@@ -1448,7 +1447,7 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
clipValuators(pDev, &mask);
- storeLastValuators(pDev, &mask, 0, 1, devx, devy);
+ storeLastValuators(pDev, &mask, devx, devy);
/* Update the MD's coordinates, which are always in desktop space. */
if (!IsMaster(pDev) && !IsFloating(pDev)) {
@@ -2008,7 +2007,7 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
clipValuators(dev, &mask);
if (emulate_pointer)
- storeLastValuators(dev, &mask, 0, 1, devx, devy);
+ storeLastValuators(dev, &mask, devx, devy);
/* Update the MD's coordinates, which are always in desktop space. */
if (emulate_pointer && !IsMaster(dev) && !IsFloating(dev)) {