summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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.