Skip to content

Commit

Permalink
Fix issue #33 QUIT_HANDLER check
Browse files Browse the repository at this point in the history
  • Loading branch information
amankgo committed Jan 10, 2022
1 parent bd657b1 commit aa2b908
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
9 changes: 6 additions & 3 deletions src/main/kotlin/app/MainWindow.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ import java.awt.Desktop

@Composable
fun ApplicationScope.appWindow() {
Desktop.getDesktop().setQuitHandler { e, response ->
closeApp(e.source.toString())
response.performQuit()
val desktop = Desktop.getDesktop()
if (desktop.isSupported(Desktop.Action.APP_QUIT_HANDLER)) {
desktop.setQuitHandler { e, response ->
closeApp(e.source.toString())
response.performQuit()
}
}
val onCloseRequest = {
closeApp("User Close")
Expand Down

0 comments on commit aa2b908

Please sign in to comment.