[Scummvm-tracker] [ScummVM :: Bugs] #14741: GRAPHICS: MACTUI: Slowdown in Macintosh menu when moving cursor over menu bar

ScummVM :: Bugs trac at scummvm.org
Fri Dec 8 11:01:29 UTC 2023


#14741: GRAPHICS: MACTUI: Slowdown in Macintosh menu when moving cursor over menu
bar
-------------------------+----------------------
Reporter:  eriktorbjorn  |      Owner:  (none)
    Type:  defect        |     Status:  new
Priority:  normal        |  Component:  Graphics
 Version:                |   Keywords:
    Game:                |
-------------------------+----------------------
 Something I've noticed on my (no longer very new) computer with the
 Macintosh menus, e.g. in the Macintosh versions of Loom and Indy 3:

 If I open a menu, then move the mouse to the right of the last menu in the
 menu bar (while still keeping the mouse within the menu bar), ScummVM
 starts using excessive amounts of CPU to the point where it doesn't even
 have the resources to keep the mouse cursor updated. It appears to freeze.

 I have tentatively traced this to how MacMenu::processEvent() is called.

 MacWindowManager::processEvent() calls MacMenu::processEvent(). That's all
 well and good.

 MacMenu::processEvent() handles the EVENT_MOUSEMOVE event, which calls
 MacMenu::mouseMove(). That function will call MacMenu::mouseClick(),
 perhaps so that sub menus are automatically opened? (At first I thought
 the problem was that it calls draw() for every processEvent() which, when
 including mouse movement, could be excessive. But apparently draw is well-
 behaved, and doesn't bog down unnecessarily.)

 In `kWMModalMenuMode`, MacMenu::mouseClick() will call
 MacMenu::eventLoop(), which then - recursively - calls
 MacMenu::processEvent(), and that's where my eyes start to glaze over
 because I don't know what it's doing at this point. If I remove the call
 to eventLoop(), the problem goes away for me but I have no idea what else
 I've broken in that process.

 As far as I can tell, sev wrote this code and the call to eventLoop() was
 part of the "Initial code for truly modal MacMenu".
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/14741>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list