Closed agoode closed 6 months ago
Ha, it's just a busy loop.
while (!Button())
;
while (Button())
;
https://github.com/jcreedcmu/twelf-mac/blob/main/docker/twelf-app/menus.c#L152-L155
Replacing it with an actual event loop at that least handles idle events makes sense.
There is something very fishy going on. Even with WaitNextEvent
, when I create the about box modelessly, relying on the main event loop, setting the about box's window's refCon
to a sentinel value to exempt it from IsAppWindow
(for IsAppWindow() = true
generally means that docTE is assumed to exist) then the presence of a modeless about window also prevents background processes from ticking forward, or at least prevents them from visibly updating. I need to bisect between the 'good' state of creating a fully fledged document window (which demonstrably works, and doesn't disrupt background updates) and the 'bad' state of whatever the about window currently is.
Completely redoing how the about box is handled --- making it a distinct type of window, and making sure I'm handling both kinds correctly everywhere --- seems to solve the problem.
I do think it should be modal since that fits the classic mac style. And actually going to "About Finder..." (hold down Option) does freeze the clock. So maybe we actually want that? (Sorry)
Hmmmmmm. Interesting. I notice some variation.
About TextEdit: modeless About this Macintosh: modeless
About Script Editor: modal alert, (clock continues in background) but with a button that opens a modeless "credits" window that looks like a styled TextEdit with scrollbars.
About ResEdit: modal, click or keypress to dismiss (clock continues in background) About Stuffit Expander: modal, click to transition to a second screen, then click to dismiss (clock continues in background)
About Netscape: launches about page within browser
This is making me feel like a wide range of idiosyncratic things are reasonably acceptable. I do kind of like the idea of keeping open the possibility of modal with some animation that kicks in after a minute, like the "About Finder..." does, and which I feel some faint memory that I've seen other programs do that.
Current state of repo as of 7cac2a43886eeb4a6d4ac059300eeb2c3ebd7eb4 is "modal, allows background computation". Are we happy with this?
Oh I love the current behavior now!
Even the clock stops ticking.
Maybe it is calling GetNextEvent instead of WaitNextEvent?