diff --git a/dix/getevents.c b/dix/getevents.c index b2b8f124f..5dceec39b 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -1343,7 +1343,7 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type, int buttons, CARD32 ms, int flags, const ValuatorMask *mask_in) { - int num_events = 1; + int num_events = 0; DeviceEvent *event; RawDeviceEvent *raw = NULL; double screenx = 0.0, screeny = 0.0; /* desktop coordinate system */ @@ -1386,6 +1386,10 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type, num_events++; init_raw(pDev, raw, ms, type, buttons); + + if (flags & POINTER_EMULATED) + raw->flags = XIPointerEmulated; + set_raw_valuators(raw, &mask, TRUE, raw->valuators.data_raw); } @@ -1454,36 +1458,37 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type, master->last.valuators[1] = screeny; } - event = &events->device_event; - init_device_event(event, pDev, ms, EVENT_SOURCE_NORMAL); + if ((flags & POINTER_RAWONLY) == 0) { + num_events++; - if (type == MotionNotify) { - event->type = ET_Motion; - event->detail.button = 0; - } - else { - if (type == ButtonPress) { - event->type = ET_ButtonPress; - set_button_down(pDev, buttons, BUTTON_POSTED); + event = &events->device_event; + init_device_event(event, pDev, ms, EVENT_SOURCE_NORMAL); + + if (type == MotionNotify) { + event->type = ET_Motion; + event->detail.button = 0; } - else if (type == ButtonRelease) { - event->type = ET_ButtonRelease; - set_button_up(pDev, buttons, BUTTON_POSTED); + else { + if (type == ButtonPress) { + event->type = ET_ButtonPress; + set_button_down(pDev, buttons, BUTTON_POSTED); + } + else if (type == ButtonRelease) { + event->type = ET_ButtonRelease; + set_button_up(pDev, buttons, BUTTON_POSTED); + } + event->detail.button = buttons; } - event->detail.button = buttons; + + /* root_x and root_y must be in per-screen coordinates */ + event_set_root_coordinates(event, screenx - scr->x, screeny - scr->y); + + if (flags & POINTER_EMULATED) + event->flags = XIPointerEmulated; + + set_valuators(pDev, event, &mask); } - /* root_x and root_y must be in per-screen coordinates */ - event_set_root_coordinates(event, screenx - scr->x, screeny - scr->y); - - if (flags & POINTER_EMULATED) { - if (raw) - raw->flags = XIPointerEmulated; - event->flags = XIPointerEmulated; - } - - set_valuators(pDev, event, &mask); - return num_events; } diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h index af1fe4187..7b478d5c2 100644 --- a/hw/xfree86/common/xf86Module.h +++ b/hw/xfree86/common/xf86Module.h @@ -75,7 +75,7 @@ */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) #define ABI_VIDEODRV_VERSION SET_ABI_VERSION(25, 2) -#define ABI_XINPUT_VERSION SET_ABI_VERSION(24, 2) +#define ABI_XINPUT_VERSION SET_ABI_VERSION(24, 3) #define ABI_EXTENSION_VERSION SET_ABI_VERSION(10, 0) #define MODINFOSTRING1 0xef23fdc5 diff --git a/include/input.h b/include/input.h index 0208562d9..98fdf0aed 100644 --- a/include/input.h +++ b/include/input.h @@ -94,6 +94,7 @@ SOFTWARE. #define POINTER_NORAW (1 << 5) /* Don't generate RawEvents */ #define POINTER_EMULATED (1 << 6) /* Event was emulated from another event */ #define POINTER_DESKTOP (1 << 7) /* Data in desktop coordinates */ +#define POINTER_RAWONLY (1 << 8) /* Only generate RawEvents */ /* GetTouchEvent flags */ #define TOUCH_ACCEPT (1 << 0)