Update to type-specific raw events - require inputproto 1.9.99.14.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2009-07-13 15:09:38 +10:00
parent 81b64f6685
commit d040af7fa3
9 changed files with 57 additions and 17 deletions

View File

@ -986,7 +986,11 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
CHECKEVENT(ev);
if (ev->any.type == ET_Raw)
if (ev->any.type == ET_RawKeyPress ||
ev->any.type == ET_RawKeyRelease ||
ev->any.type == ET_RawButtonPress ||
ev->any.type == ET_RawButtonRelease ||
ev->any.type == ET_RawMotion)
{
ProcessRawEvent((RawDeviceEvent*)ev, device);
return;

View File

@ -102,6 +102,18 @@ ProcXISelectEvents(ClientPtr client)
return BadValue;
}
/* Raw events may only be selected on root windows */
if (win->parent && evmask->mask_len >= 1)
{
unsigned char *bits = (unsigned char*)&evmask[1];
if (BitIsOn(bits, XI_RawKeyPress) ||
BitIsOn(bits, XI_RawKeyRelease) ||
BitIsOn(bits, XI_RawButtonPress) ||
BitIsOn(bits, XI_RawButtonRelease) ||
BitIsOn(bits, XI_RawMotion))
return BadValue;
}
if ((evmask->mask_len * 4) >= (XI2LASTEVENT + 8)/8)
{
unsigned char *bits = (unsigned char*)&evmask[1];

View File

@ -704,7 +704,7 @@ XEXT_LIB='$(top_builddir)/Xext/libXext.la'
XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la'
dnl Core modules for most extensions, et al.
REQUIRED_MODULES="[randrproto >= 1.2.99.3] [renderproto >= 0.11] [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto [xextproto >= 7.0.3] [xproto >= 7.0.13] [xtrans >= 1.2.2] bigreqsproto resourceproto fontsproto [inputproto >= 1.9.99.13] [kbproto >= 1.0.3]"
REQUIRED_MODULES="[randrproto >= 1.2.99.3] [renderproto >= 0.11] [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto [xextproto >= 7.0.3] [xproto >= 7.0.13] [xtrans >= 1.2.2] bigreqsproto resourceproto fontsproto [inputproto >= 1.9.99.14] [kbproto >= 1.0.3]"
REQUIRED_LIBS="xfont xau fontenc [pixman-1 >= 0.15.14]"
dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas

View File

@ -94,7 +94,11 @@ EventToCore(InternalEvent *event, xEvent *core)
break;
case ET_ProximityIn:
case ET_ProximityOut:
case ET_Raw:
case ET_RawKeyPress:
case ET_RawKeyRelease:
case ET_RawButtonPress:
case ET_RawButtonRelease:
case ET_RawMotion:
return BadMatch;
default:
/* XXX: */
@ -135,7 +139,11 @@ EventToXI(InternalEvent *ev, xEvent **xi, int *count)
case ET_ProximityOut:
return eventToKeyButtonPointer((DeviceEvent*)ev, xi, count);
case ET_DeviceChanged:
case ET_Raw:
case ET_RawKeyPress:
case ET_RawKeyRelease:
case ET_RawButtonPress:
case ET_RawButtonRelease:
case ET_RawMotion:
*count = 0;
*xi = NULL;
return BadMatch;
@ -182,7 +190,11 @@ EventToXI2(InternalEvent *ev, xEvent **xi)
return BadMatch;
case ET_DeviceChanged:
return eventToClassesChanged((DeviceChangedEvent*)ev, xi);
case ET_Raw:
case ET_RawKeyPress:
case ET_RawKeyRelease:
case ET_RawButtonPress:
case ET_RawButtonRelease:
case ET_RawMotion:
return eventToRawEvent((RawDeviceEvent*)ev, xi);
}
@ -469,7 +481,6 @@ eventToRawEvent(RawDeviceEvent *ev, xEvent **xi)
raw->evtype = GetXI2Type((InternalEvent*)ev);
raw->time = ev->time;
raw->length = bytes_to_int32(len - sizeof(xEvent));
raw->eventtype = ev->subtype;
raw->detail = ev->detail.button;
raw->deviceid = ev->deviceid;
raw->valuators_len = vallen;
@ -552,7 +563,11 @@ GetXI2Type(InternalEvent *event)
case ET_Leave: xi2type = XI_Leave; break;
case ET_Hierarchy: xi2type = XI_HierarchyChanged; break;
case ET_DeviceChanged: xi2type = XI_DeviceChanged; break;
case ET_Raw: xi2type = XI_RawEvent; break;
case ET_RawKeyPress: xi2type = XI_RawKeyPress; break;
case ET_RawKeyRelease: xi2type = XI_RawKeyRelease; break;
case ET_RawButtonPress: xi2type = XI_RawButtonPress; break;
case ET_RawButtonRelease: xi2type = XI_RawButtonRelease; break;
case ET_RawMotion: xi2type = XI_RawMotion; break;
case ET_FocusIn: xi2type = XI_FocusIn; break;
case ET_FocusOut: xi2type = XI_FocusOut; break;
default:

View File

@ -2188,7 +2188,11 @@ FixUpEventFromWindow(
{
xXIDeviceEvent* event = (xXIDeviceEvent*)xE;
if (event->evtype == XI_RawEvent)
if (event->evtype == XI_RawKeyPress ||
event->evtype == XI_RawKeyRelease ||
event->evtype == XI_RawButtonPress ||
event->evtype == XI_RawButtonRelease ||
event->evtype == XI_RawMotion)
return;
event->root = RootWindow(pDev)->drawable.id;

View File

@ -138,14 +138,12 @@ init_event(DeviceIntPtr dev, DeviceEvent* event, Time ms)
}
static void
init_raw(DeviceIntPtr dev, RawDeviceEvent *event, Time ms, int subtype,
int detail)
init_raw(DeviceIntPtr dev, RawDeviceEvent *event, Time ms, int type, int detail)
{
memset(event, 0, sizeof(RawDeviceEvent));
event->header = ET_Internal;
event->length = sizeof(RawDeviceEvent);
event->type = ET_Raw;
event->subtype = subtype;
event->type = ET_RawKeyPress - ET_KeyPress + type;
event->time = ms;
event->deviceid = dev->id;
event->sourceid = dev->id;

View File

@ -41,6 +41,7 @@
* protocol.
*
* Note: Keep KeyPress to Motion aligned with the core events.
* Keep ET_Raw* in the same order as KeyPress - Motion
*/
enum {
ET_KeyPress = 2,
@ -59,7 +60,11 @@ enum {
#if XFreeXDGA
ET_DGAEvent,
#endif
ET_Raw,
ET_RawKeyPress,
ET_RawKeyRelease,
ET_RawButtonPress,
ET_RawButtonRelease,
ET_RawMotion,
ET_Internal = 0xFF /* First byte */
} EventType;
@ -193,8 +198,6 @@ typedef struct
int type; /**< ET_Raw */
int length; /**< Length in bytes */
Time time; /**< Time in ms */
int subtype; /**< KeyPress, KeyRelease, ButtonPress,
ButtonRelease, MotionNotify */
int deviceid; /**< Device to post this event for */
int sourceid; /**< The physical source device */
union {

View File

@ -69,7 +69,7 @@ SOFTWARE.
* events to the protocol, the server will not support these events until
* this number here is bumped.
*/
#define XI2LASTEVENT 13 /* XI_PropertyEvent */
#define XI2LASTEVENT 17 /* XI_RawMotion */
#define XI2MASKSIZE ((XI2LASTEVENT + 7)/8) /* no of bits for masks */
/**

View File

@ -281,7 +281,11 @@ ChangeDeviceID(DeviceIntPtr dev, InternalEvent* event)
case ET_DGAEvent:
break;
#endif
case ET_Raw:
case ET_RawKeyPress:
case ET_RawKeyRelease:
case ET_RawButtonPress:
case ET_RawButtonRelease:
case ET_RawMotion:
event->raw.deviceid = dev->id;
break;
default: