summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Byer <bbyer@apple.com>2008-03-31 17:48:09 -0700
committerBen Byer <bbyer@apple.com>2008-03-31 21:33:29 -0700
commita9e081a60ca227c0d96d4613075d97d6b762366a (patch)
treed0295dd30c20d21202344071fdb5ee53ff8034b4
parent9a03ae33c4f9de830f15eabf3b994882ead7c000 (diff)
gut darwinEQEnqueue, and make it just call mieqEnqueue (for the moment)
-rw-r--r--hw/xquartz/darwinEvents.c40
1 files changed, 7 insertions, 33 deletions
diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index e9ad2344c..9c8efa0c1 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -199,7 +199,11 @@ void DarwinEventHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, int neven
int i;
DEBUG_LOG("DarwinEventHandler(%d, %p, %p, %d)\n", screenNum, xe, dev, nevents);
- for (i=0; i<nevents; i++) QuartzProcessEvent(&xe[i]);
+ for (i=0; i<nevents; i++) {
+ if (xe[i].u.u.type == kXquartzDeactivate)
+ DarwinReleaseModifiers();
+ QuartzProcessEvent(&xe[i]);
+ }
}
Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr) {
@@ -242,40 +246,10 @@ Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr) {
* This should be deprecated in favor of miEQEnqueue -- BB
*/
void DarwinEQEnqueue(const xEventPtr e) {
- HWEventQueueType oldtail, newtail;
-
- oldtail = darwinEventQueue.tail;
-
- // mieqEnqueue() collapses successive motion events into one event.
- // This is difficult to do in a thread-safe way and rarely useful.
-
- newtail = oldtail + 1;
- if (newtail == QUEUE_SIZE) newtail = 0;
- /* Toss events which come in late */
- if (newtail == darwinEventQueue.head) return;
-
- darwinEventQueue.events[oldtail].event = *e;
-
- /*
- * Make sure that event times don't go backwards - this
- * is "unnecessary", but very useful
- */
- if (e->u.keyButtonPointer.time < darwinEventQueue.lastEventTime &&
- darwinEventQueue.lastEventTime - e->u.keyButtonPointer.time < 10000)
- {
- darwinEventQueue.events[oldtail].event.u.keyButtonPointer.time =
- darwinEventQueue.lastEventTime;
- }
- darwinEventQueue.events[oldtail].pScreen = darwinEventQueue.pEnqueueScreen;
-
- // Update the tail after the event is prepared
- darwinEventQueue.tail = newtail;
-
- // Signal there is an event ready to handle
- DarwinPokeEQ();
+ mieqEnqueue(NULL, e);
+ DarwinPokeEQ();
}
-
/*
* DarwinEQPointerPost
* Post a pointer event. Used by the mipointer.c routines.