<div dir="ltr"><div>Hi Everyone,</div><div><br>In one project, we have to handle the quit-logic for MacOS ourselves,<br>when the <quit app> menu entry is used.<br>As background information - this menu entry is set in the class com.sun.glass.ui.mac.MacApplication.<br>It's basically hard coded. Currently, in this project, the menu entry doesn't work in some cases.<br><br>My Solution would be:<br><br>Provide a method "Platform.setQuiteHandler(Supplier<Boolean>)"<br>This handler is called when quit <appname> from the menu is called.<br>If the handler returns true, all windows are closed. Otherwise, nothing happens.<br><br>It would look like the following:<br>```<br>/**<br> * Sets the handler to be called when the application is about to quit.<br> * Currently, this can only happen on MacOS.<br> *<br> * This handler is called, when the user selects<br> * the "Quit <appname>" from the application menu.<br> * When the provided handler returns true,<br> * the application will close all windows.<br> * If the handler returns false, the application will not quit.<br> *<br> * @param The new quit handler.<br> */<br>public static void setQuitHandler(Supplier x) {<br>    ...<br>}<br>```<br>I've created a ticket for this topic. <a href="https://bugs.openjdk.org/browse/JDK-8293700">https://bugs.openjdk.org/browse/JDK-8293700</a></div><div><br>I've got a working version for this change. </div><div>According to Kevin Rushforth this need a prior dicussion on the mailing list.</div><div>Any opinion regarding this?<br><br>I could provide a pullrequest, if someone is interested.<br><br>Florian Kirmaier<br></div></div>