summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Xi/exevents.c6
-rw-r--r--Xi/xiselectev.c12
-rw-r--r--configure.ac2
-rw-r--r--dix/eventconvert.c25
-rw-r--r--dix/events.c6
-rw-r--r--dix/getevents.c6
-rw-r--r--include/events.h9
-rw-r--r--include/inputstr.h2
-rw-r--r--mi/mieq.c6
9 files changed, 57 insertions, 17 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 85baa03a9..984bc0718 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -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;
diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c
index 2baae77f6..d7b16446f 100644
--- a/Xi/xiselectev.c
+++ b/Xi/xiselectev.c
@@ -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];
diff --git a/configure.ac b/configure.ac
index 43288c1c7..cd11f21ea 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
diff --git a/dix/eventconvert.c b/dix/eventconvert.c
index 8d9a329c1..765c84b66 100644
--- a/dix/eventconvert.c
+++ b/dix/eventconvert.c
@@ -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:
diff --git a/dix/events.c b/dix/events.c
index 91a083364..f6369f6c6 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -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;
diff --git a/dix/getevents.c b/dix/getevents.c
index fcac056aa..13e7576a8 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -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;
diff --git a/include/events.h b/include/events.h
index d34637eba..4b0c6dcb4 100644
--- a/include/events.h
+++ b/include/events.h
@@ -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 {
diff --git a/include/inputstr.h b/include/inputstr.h
index 73750e0e3..29ad5a814 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -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 */
/**
diff --git a/mi/mieq.c b/mi/mieq.c
index 0f07b168e..fd2de0e24 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -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: