浏览代码

Handle close request event for main window

When receiving close request event, main window should quit program
if there is no system tray available, and just like the close button
was clicked. The window close request event happens when user close
window by pressing alt-f4 (Gnome) or when receiving WM_DELETE_WINDOW
xwindow event. Current behavior is just close the window and let the
program keep running, and there is no way to quit program without
system tray.
En-Jan Chou 5 年之前
父节点
当前提交
b6a4f70ec9
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      main/ui/src/main/java/org/cryptomator/ui/mainwindow/MainWindowTitleController.java

+ 3 - 0
main/ui/src/main/java/org/cryptomator/ui/mainwindow/MainWindowTitleController.java

@@ -57,6 +57,9 @@ public class MainWindowTitleController implements FxController {
 			window.setX(event.getScreenX() - xOffset);
 			window.setY(event.getScreenY() - yOffset);
 		});
+		window.setOnCloseRequest(event -> {
+			close();
+		});
 	}
 
 	@FXML