diff options
-rw-r--r-- | Xi/exevents.c | 8 | ||||
-rw-r--r-- | include/inputstr.h | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index 5ab9d660f..f3f9d390b 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -943,16 +943,16 @@ UpdateDeviceState(DeviceIntPtr device, xEvent* xE, int count) kptr = &b->down[key >> 3]; if ((*kptr & bit) != 0) return DONT_PROCESS; *kptr |= bit; if (device->valuator) device->valuator->motionHintWindow = NullWindow; - b->buttonsDown++; - b->motionMask = DeviceButtonMotionMask; if (!b->map[key]) return DONT_PROCESS; + b->buttonsDown++; + b->motionMask = DeviceButtonMotionMask; if (b->map[key] <= 5) b->state |= (Button1Mask >> 1) << b->map[key]; SetMaskForEvent(device->id, Motion_Filter(b), DeviceMotionNotify); } else if (xE->u.u.type == DeviceButtonRelease) { if (!b) return DONT_PROCESS; @@ -975,16 +975,16 @@ UpdateDeviceState(DeviceIntPtr device, xEvent* xE, int count) return DONT_PROCESS; } } *kptr &= ~bit; if (device->valuator) device->valuator->motionHintWindow = NullWindow; - if (b->buttonsDown >= 1 && !--b->buttonsDown) - b->motionMask = 0; if (!b->map[key]) return DONT_PROCESS; + if (b->buttonsDown >= 1 && !--b->buttonsDown) + b->motionMask = 0; if (b->map[key] <= 5) b->state &= ~((Button1Mask >> 1) << b->map[key]); SetMaskForEvent(device->id, Motion_Filter(b), DeviceMotionNotify); } else if (xE->u.u.type == ProximityIn) device->valuator->mode &= ~OutOfProximity; else if (xE->u.u.type == ProximityOut) diff --git a/include/inputstr.h b/include/inputstr.h index 039d5bc23..adb7b9a40 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -182,13 +182,17 @@ typedef struct _ValuatorClassRec { CARD8 mode; ValuatorAccelerationRec accelScheme; } ValuatorClassRec, *ValuatorClassPtr; typedef struct _ButtonClassRec { CARD8 numButtons; - CARD8 buttonsDown; /* number of buttons currently down */ + CARD8 buttonsDown; /* number of buttons currently down + This counts logical buttons, not + physical ones, i.e if some buttons + are mapped to 0, they're not counted + here */ unsigned short state; Mask motionMask; CARD8 down[DOWN_LENGTH]; CARD8 map[MAP_LENGTH]; #ifdef XKB union _XkbAction *xkb_acts; |