arduino-ide icon indicating copy to clipboard operation
arduino-ide copied to clipboard

[ATL-483] mac not to quit with all windows closed

Open fstasi opened this issue 3 years ago • 3 comments

Why

As reported closing the IDE when the last window is closed is an uncommon pattern in IDEs, and for good. This will enable opening projects from within the IDE2 even when no projects are currently open.

How

Listen to quit event and close the application only if not running on macOS

Jira task

fstasi avatar Aug 25 '21 15:08 fstasi

Fixes https://github.com/arduino/arduino-ide/issues/91

per1234 avatar Nov 01 '21 00:11 per1234

No explanation was provided for the closure of this PR, so I reopen it. If it is to be closed, the reason must be clearly documented:

Was the approach taken in the PR fatally flawed? If so, document exactly what was the flaw so that the mistake can be avoided on the next attempt.

Is there some unfinished work on the PR? If so, document exactly what is missing so that work can be completed.

per1234 avatar Sep 27 '22 06:09 per1234

It would be a lot of work to complete this PR. All menu bar handling is on the renderer side. Each renderer builds its own menu tree and then calls on main to install it (CHANNEL_SET_MENU_WITH_NODE_ID). Main builds a native copy of the menu tree and installs the copy. When a menu item is clicked on main calls back into the renderer to invoke the handler (CHANNEL_MAIN_MENU_ITEM_DID_CLICK).

When the last sketch window is closed the native menu bar is left behind. Attempting to execute an item causes main to send a message to the destroyed renderer leading to an uncaught exception.

From what I can tell this architecture is inherited from Theia.

beldenfox avatar May 17 '23 15:05 beldenfox