diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-06-24 11:02:23 +1000 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2011-07-09 14:28:28 -0700 |
commit | afb537d56af9a037c4f43d90795fb7e9acb7f9d2 (patch) | |
tree | e8fcc04fd38d19320833be82650812275a686288 | |
parent | 6b06f376544f222e426f0a35d22d69df0c523882 (diff) |
input: add POINTER_NORAW to avoid generation of raw events (#30068)
RawEvents are supposed to be events coming from the driver. When warping the
pointer, this should not generate a raw event.
X.Org Bug 30068 <http://bugs.freedesktop.org/show_bug.cgi?id=30068>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 23a783278963919778d017965542e0f983814e37)
Conflicts:
dix/getevents.c
-rw-r--r-- | dix/getevents.c | 18 | ||||
-rw-r--r-- | include/input.h | 9 | ||||
-rw-r--r-- | mi/mipointer.c | 2 |
3 files changed, 17 insertions, 12 deletions
diff --git a/dix/getevents.c b/dix/getevents.c index 8355040f1..ba93818e9 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -1136,14 +1136,17 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, events = UpdateFromMaster(events, pDev, DEVCHANGE_POINTER_EVENT, &num_events); - raw = (RawDeviceEvent*)events->event; - events++; - num_events++; - valuator_mask_copy(&mask, mask_in); - init_raw(pDev, raw, ms, type, buttons); - set_raw_valuators(raw, &mask, raw->valuators.data_raw); + if ((flags & POINTER_NORAW) == 0) + { + raw = (RawDeviceEvent*)events->event; + events++; + num_events++; + + init_raw(pDev, raw, ms, type, buttons); + set_raw_valuators(raw, &mask, raw->valuators.data_raw); + } if (flags & POINTER_ABSOLUTE) { @@ -1195,7 +1198,8 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, moveRelative(pDev, &x, &y, &mask); } - set_raw_valuators(raw, &mask, raw->valuators.data); + if ((flags & POINTER_NORAW) == 0) + set_raw_valuators(raw, &mask, raw->valuators.data); positionSprite(pDev, &x, &y, x_frac, y_frac, scr, &cx, &cy, &cx_frac, &cy_frac); updateHistory(pDev, &mask, ms); diff --git a/include/input.h b/include/input.h index 95aae43fc..eb25fc6c5 100644 --- a/include/input.h +++ b/include/input.h @@ -62,10 +62,11 @@ SOFTWARE. #define DEVICE_OFF 2 #define DEVICE_CLOSE 3 -#define POINTER_RELATIVE (1 << 1) -#define POINTER_ABSOLUTE (1 << 2) -#define POINTER_ACCELERATE (1 << 3) -#define POINTER_SCREEN (1 << 4) /* Data in screen coordinates */ +#define POINTER_RELATIVE (1 << 1) +#define POINTER_ABSOLUTE (1 << 2) +#define POINTER_ACCELERATE (1 << 3) +#define POINTER_SCREEN (1 << 4) /* Data in screen coordinates */ +#define POINTER_NORAW (1 << 5) /* Don't generate RawEvents */ /*int constants for pointer acceleration schemes*/ #define PtrAccelNoOp 0 diff --git a/mi/mipointer.c b/mi/mipointer.c index ca0bae51b..bfe97542d 100644 --- a/mi/mipointer.c +++ b/mi/mipointer.c @@ -574,7 +574,7 @@ miPointerMove (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) valuator_mask_set_range(&mask, 0, 2, valuators); nevents = GetPointerEvents(events, pDev, MotionNotify, 0, - POINTER_SCREEN | POINTER_ABSOLUTE, &mask); + POINTER_SCREEN | POINTER_ABSOLUTE | POINTER_NORAW, &mask); OsBlockSignals(); #ifdef XQUARTZ |