summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mi/mieq.c4
-rw-r--r--test/input.c14
2 files changed, 17 insertions, 1 deletions
diff --git a/mi/mieq.c b/mi/mieq.c
index 36aa21357..0e27405cc 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -515,6 +515,10 @@ mieqProcessDeviceEvent(DeviceIntPtr dev, InternalEvent *event, ScreenPtr screen)
verify_internal_event(event);
+ /* refuse events from disabled devices */
+ if (!dev->enabled)
+ return 0;
+
/* Custom event handler */
handler = miEventQueue.handlers[event->any.type];
diff --git a/test/input.c b/test/input.c
index 9b5db8991..a4615c9c9 100644
--- a/test/input.c
+++ b/test/input.c
@@ -1712,6 +1712,18 @@ mieq_test_event_handler(int screenNum, InternalEvent *ie, DeviceIntPtr dev)
static void
_mieq_test_generate_events(uint32_t start, uint32_t count)
{
+ static DeviceIntRec dev;
+ static SpriteInfoRec spriteInfo;
+ static SpriteRec sprite;
+
+ memset(&dev, 0, sizeof(dev));
+ memset(&spriteInfo, 0, sizeof(spriteInfo));
+ memset(&sprite, 0, sizeof(sprite));
+ dev.spriteInfo = &spriteInfo;
+ spriteInfo.sprite = &sprite;
+
+ dev.enabled = 1;
+
count += start;
while (start < count) {
RawDeviceEvent e = { 0 };
@@ -1721,7 +1733,7 @@ _mieq_test_generate_events(uint32_t start, uint32_t count)
e.time = GetTimeInMillis();
e.flags = start;
- mieqEnqueue(NULL, (InternalEvent *) &e);
+ mieqEnqueue(&dev, (InternalEvent *) &e);
start++;
}