From f724e672f8b65e4be74b73711e996e8b1bb78291 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 16 Dec 2019 11:09:15 +0100 Subject: GRAPHICS: MACGUI: Save background on menu activation --- graphics/macgui/macmenu.cpp | 2 ++ graphics/macgui/macwindowmanager.cpp | 18 +++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'graphics/macgui') diff --git a/graphics/macgui/macmenu.cpp b/graphics/macgui/macmenu.cpp index a6788007ed..54b9c9e91f 100644 --- a/graphics/macgui/macmenu.cpp +++ b/graphics/macgui/macmenu.cpp @@ -959,6 +959,8 @@ bool MacMenu::mouseClick(int x, int y) { _contentIsDirty = true; _wm->setFullRefresh(true); + _wm->activateMenu(); + return true; } } diff --git a/graphics/macgui/macwindowmanager.cpp b/graphics/macgui/macwindowmanager.cpp index 900c06dff5..f48a2faf74 100644 --- a/graphics/macgui/macwindowmanager.cpp +++ b/graphics/macgui/macwindowmanager.cpp @@ -239,6 +239,15 @@ void MacWindowManager::activateMenu() { if (!_menu) return; + if (_mode & kWMModalMenuMode) { + warning("HHERE"); + if (!_screenCopy) + _screenCopy = new ManagedSurface(*_screen); // Create a copy + else + *_screenCopy = *_screen; + pauseEngine(true); + } + _menu->setVisible(true); } @@ -355,13 +364,6 @@ static void menuTimerHandler(void *refCon) { if (wm->_menuHotzone.contains(wm->_lastMousePos)) { wm->activateMenu(); - if (wm->_mode & kWMModalMenuMode) { - if (!wm->_screenCopy) - wm->_screenCopy = new ManagedSurface(*wm->_screen); // Create a copy - else - *wm->_screenCopy = *wm->_screen; - wm->pauseEngine(true); - } } wm->_menuTimerActive = false; @@ -539,6 +541,8 @@ void MacWindowManager::passPalette(const byte *pal, uint size) { void MacWindowManager::pauseEngine(bool pause) { if (_engineP && _pauseEngineCallback) { _pauseEngineCallback(_engineP, pause); + } else { + warning("MacWindowManager::pauseEngine(): no pauseEngineCallback is set"); } } -- cgit v1.2.3