diff --git a/graphics/macgui/macwindowmanager.cpp b/graphics/macgui/macwindowmanager.cpp index 3d333839b6b..41de14620fb 100644 --- a/graphics/macgui/macwindowmanager.cpp +++ b/graphics/macgui/macwindowmanager.cpp @@ -177,6 +177,8 @@ MacWindowManager::MacWindowManager(uint32 mode, MacPatterns *patterns, Common::L _menuDelay = 0; _menuTimerActive = false; + _activateScreenCopy = false; + _engineP = nullptr; _engineR = nullptr; _redrawEngineCallback = nullptr; @@ -447,14 +449,14 @@ void MacWindowManager::activateMenu() { return; if (_mode & kWMModalMenuMode) { - activateScreenCopy(); + _activateScreenCopy = true; } _menu->setVisible(true); } void MacWindowManager::activateScreenCopy() { - Common::StackLock lock(_mutex); + // This is only called when the _mutex is already held if (_screen) { if (!_screenCopy) @@ -897,6 +899,11 @@ void MacWindowManager::drawDesktop() { void MacWindowManager::draw() { Common::StackLock lock(_mutex); + if (_activateScreenCopy) { + _activateScreenCopy = false; + activateScreenCopy(); + } + removeMarked(); Common::Rect bounds = getScreenBounds(); diff --git a/graphics/macgui/macwindowmanager.h b/graphics/macgui/macwindowmanager.h index 22a128c77a0..feeb3a7ca98 100644 --- a/graphics/macgui/macwindowmanager.h +++ b/graphics/macgui/macwindowmanager.h @@ -457,6 +457,8 @@ private: MacMenu *_menu; uint32 _menuDelay; + bool _activateScreenCopy; + Engine *_engineP; void *_engineR; void (*_redrawEngineCallback)(void *engine);