diff options
author | sluicebox | 2019-03-31 02:53:21 -0700 |
---|---|---|
committer | Filippos Karapetis | 2019-04-01 01:16:53 +0300 |
commit | 82ccce948aaafed2f8e847359ab87c1a4878c74b (patch) | |
tree | 3f1d2c81462045fb7682e9ebe69b9f0d415015e2 /engines/sci/engine/kevent.cpp | |
parent | 423dcd0a0116aa05894cc816fa266173e705ae63 (diff) | |
download | scummvm-rg350-82ccce948aaafed2f8e847359ab87c1a4878c74b.tar.gz scummvm-rg350-82ccce948aaafed2f8e847359ab87c1a4878c74b.tar.bz2 scummvm-rg350-82ccce948aaafed2f8e847359ab87c1a4878c74b.zip |
SCI: Fix Mac icon bar event handling
Fix mouse presses falling through the icon bar in KQ6 and FPFP Mac
Diffstat (limited to 'engines/sci/engine/kevent.cpp')
-rw-r--r-- | engines/sci/engine/kevent.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
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; } |