소스 검색

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