You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First: thanks to all contributors. JWM does indeed play nicely with Skija (I've been making a UI toolkit for Scala -- soon to go open).
I've been unable to intercept CMD-Q in order to ask the user what she wants to do next (I can, of course, handle window-close requests from the traffic-light). The usual code for installing a quit handler runs without reporting any problem: but cmd-Q just quits the app. I realize there's no reason I should expect the awt.desktop stuff to work; but that's all I have.
/**
* This doesn't fail; but it doesn't prevent CMD-Q from torpedoing an in-flight app.
*/
locally {
if (java.awt.Desktop.isDesktopSupported) {
val desk = java.awt.Desktop.getDesktop
desk.disableSuddenTermination()
if (!desk.isSupported(java.awt.Desktop.Action.APP_QUIT_HANDLER)) println(s"Can't handle Quit")
desk.setQuitHandler(new java.awt.desktop.QuitHandler {
def handleQuitRequestWith(e: QuitEvent, response: QuitResponse): Unit = {
println(s"Quit: $e")
if (false) response.performQuit() else response.cancelQuit()
}
})
} else println("Desktop not supported")
The text was updated successfully, but these errors were encountered:
First: thanks to all contributors. JWM does indeed play nicely with Skija (I've been making a UI toolkit for Scala -- soon to go open).
I've been unable to intercept CMD-Q in order to ask the user what she wants to do next (I can, of course, handle window-close requests from the traffic-light). The usual code for installing a quit handler runs without reporting any problem: but cmd-Q just quits the app. I realize there's no reason I should expect the awt.desktop stuff to work; but that's all I have.
The text was updated successfully, but these errors were encountered: