diff options
author | Ben Byer <bbyer@apple.com> | 2008-03-31 17:48:09 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2008-04-02 17:45:23 -0700 |
commit | c6f0d5d1e51326e5110d27918d834eb0096df7db (patch) | |
tree | 8196f06a66481bf85f1dd28ed57f149ad0a8cac4 | |
parent | 5b6c273eaa53d7b554d69c2b4865988068e73a26 (diff) |
gut darwinEQEnqueue, and make it just call mieqEnqueue (for the moment)
(cherry picked from commit a9e081a60ca227c0d96d4613075d97d6b762366a)
-rw-r--r-- | hw/xquartz/darwinEvents.c | 40 |
1 files changed, 7 insertions, 33 deletions
diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c index ce21ff540..f7b141980 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. |