From 82ccce948aaafed2f8e847359ab87c1a4878c74b Mon Sep 17 00:00:00 2001 From: sluicebox Date: Sun, 31 Mar 2019 02:53:21 -0700 Subject: SCI: Fix Mac icon bar event handling Fix mouse presses falling through the icon bar in KQ6 and FPFP Mac --- engines/sci/engine/kevent.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'engines/sci/engine/kevent.cpp') diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp index 608e2e4ce9..df0e94fb8d 100644 --- a/engines/sci/engine/kevent.cpp +++ b/engines/sci/engine/kevent.cpp @@ -49,13 +49,6 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) { SegManager *segMan = s->_segMan; Common::Point mousePos; - // For Mac games with an icon bar, handle possible icon bar events first - if (g_sci->hasMacIconBar()) { - reg_t iconObj = g_sci->_gfxMacIconBar->handleEvents(); - if (!iconObj.isNull()) - invokeSelector(s, iconObj, SELECTOR(select), argc, argv, 0, NULL); - } - // If there's a simkey pending, and the game wants a keyboard event, use the // simkey instead of a normal event // TODO: This does not really work as expected for keyup events, since the @@ -78,6 +71,21 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) { curEvent = g_sci->getEventManager()->getSciEvent(mask); + // For Mac games with an icon bar, handle possible icon bar events first + if (g_sci->hasMacIconBar()) { + reg_t iconObj = NULL_REG; + if (g_sci->_gfxMacIconBar->handleEvents(curEvent, iconObj)) { + if (!iconObj.isNull()) { + invokeSelector(s, iconObj, SELECTOR(select), argc, argv, 0, NULL); + } + + // The mouse press event was handled by the mac icon bar so change + // its type to none so that generic event processing can continue + // without the mouse press being handled twice + curEvent.type = kSciEventNone; + } + } + if (g_sci->_guestAdditions->kGetEventHook()) { return NULL_REG; } -- cgit v1.2.3