MacOS app window can be closed but not reopened from menus

Steps to reproduce

Starting from scratch, what are the steps to make the bug happen?

  1. Open app
  2. Close main window (by either clicking red dot, command-W, or Window -> Close Window)

Expected result

What do you expect to see after carrying out the steps above?

Main window closes as expected, however there should be an item in the “Window” menu (and optionally a keyboard command) that will reopen the main window.

Actual result

Instead of the expected result, what happened?

Main window closes as expected, however there are no menu commands (or keyboard commands that I can see) that will reopen the main window. This is not expected MacOS behavior. Window can be reopened by clicking the dock icon or by quitting and relaunching app.


MacOS 11.5.2
Dynalist v1.0.5
Are you using any third-party scripts for Dynalist, e.g. PowerPack? No

1 Like

That sounds like typical Mac app behavior. The menu shows the 1 foreground app, even if many background apps are running. It’s exactly how Chrome and most other Mac apps work too. I know a few apps retain foreground focus, and thus keep the top menu, even with all windows closed, but that’s not typical. If I press command-W, 95% of the apps on my mac will lose top menu focus. Closing the last window is usually almost like quitting the app, but with it allowed to run in the background. If you want to minimize the window, command-H, then it will re-open faster when you click it in the dock. If you don’t want to use the dock, use command-space to open spotlight and type “dy”…Enter. Or command-tab to it.

I am not clear why you introduced focus into the discussion. The app is not losing focus. It remains the foreground app but without any visible windows displaying. App switching does not affect whether the window reappears or not (for Dynalist, at least.)

Perhaps hiding the window (command-H) is a better way to minimize, but as long as there is a menu/keystroke that closes the window (not hides the app), there should be a menu & keystroke that can reopen the window.

It is not a big deal to work around but it is weird.

Oh I see what you mean - it does keep foreground focus (& the Dynalist top menu) until you click away. I have my menu on auto-hide so I never noticed. It’s probably a fluke of Electron. I checked a couple other popular Electron apps and it seems a toss-up, a few are missing any way to re-open the windows in that lingering menu. It seems like Electron ought to add a setting to switch focus to background automatically if the developer doesn’t add a file menu.

It’s a valid bug - the devs should probably add a File > New Window with hotkey, like some electron apps have (VSCode) to Dynalist and Obsidian, since some folks look for it.

Thanks for the report, just wanted to make sure - does clicking on the icon after closing the window re-open it correctly, or does it do nothing right now?

Also, any chance you can provide a screenshot for some other app that implement this menu behavior you’d expect so we can take inspiration from? Thanks!

Yes, that does reopen it correctly. As BigChungus noted above, it reopens more slowly than if the window was “Hidden” instead of “Closed”. But the end result is the same.

There are different ways apps handle this so I am not sure what the modern way is.

  • For many, closing the main window quits the app completely so you must relaunch to get the window back.
  • I think some apps do not allow closing the main window unless you Quit (but I am not sure. I am not a developer.)
  • Some have no main window, so you open a document to open a new window. But Dynalist does not work that way.

Here are a couple of examples using the MacOS built in apps “Books” and “Calendar”. Both rely on a main window without which you can do little if anything with the app. Notice that there is a Keyboard Shortcut shown next to the menu item, which is optional. Tried uploading as AVI’s but not sure this works.
[videos removed because they are unplayable.]

Hmm I can’t seem to play them, most reliable way to send videos is to upload them to a video hosting site like youtube and put an unlisted link, or use a Dropbox/GDrive/etc link.

For many, closing the main window quits the app completely so you must relaunch to get the window back.

Originally we implemented like this, and many said this goes against MacOS conventions that closing the app window shouldn’t quit the app. Honestly to me, it sounds like it doesn’t make much of a difference because you still end up clicking on the icon to reopen it regardless.

I can’t argue very hard with that.

Here are the videos in case you’re still interested.

Here’s an Electron app that does it

Thank you both, I will think about it and see if it makes sense to change the behavior.