summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorThomas Jaeger <ThJaeger@gmail.com>2008-12-22 00:55:09 +0100
committerKeith Packard <keithp@keithp.com>2009-01-30 17:25:24 -0800
commit191161a24a80dc553b11f829c12cfffb76ec7185 (patch)
tree5bd63420ec4820e9956078f58ab57be0a59e6d96 /Xi
parentfe0abdceb483ec0bb2977016b00aef57033aa449 (diff)
Count the number of logically down buttons in buttonsDown
This fixes the following bug. Assuming your window manager grabs Alt+Button1 to move windows, map Button3 to 0 via XSetPointerMapping, then press the physical button 3 (this shouldn't have any effect), press Alt and then button 1. The press event is delivered to the application instead of firing the grab. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit f7f85f696570541e2dd43462675de9e6ee46f545)
Diffstat (limited to 'Xi')
-rw-r--r--Xi/exevents.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 2aa316102..b4359a818 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -895,10 +895,10 @@ UpdateDeviceState(DeviceIntPtr device, xEvent* xE, int count)
*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);
@@ -927,10 +927,10 @@ UpdateDeviceState(DeviceIntPtr device, xEvent* xE, int count)
*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);