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 23a7832789)

Conflicts:

	dix/getevents.c
This commit is contained in:
Peter Hutterer 2011-06-24 11:02:23 +10:00 committed by Jeremy Huddleston
parent 6b06f37654
commit afb537d56a
3 changed files with 17 additions and 12 deletions

View File

@ -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);

View File

@ -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

View File

@ -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