mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 19:17:58 +00:00
feat: add flutter tray and hide logic of main window
This commit is contained in:
@@ -509,14 +509,15 @@ class WindowActionPanelState extends State<WindowActionPanel>
|
||||
onTap: () async {
|
||||
final res = await widget.onClose?.call() ?? true;
|
||||
if (res) {
|
||||
if (widget.isMainWindow) {
|
||||
windowManager.close();
|
||||
} else {
|
||||
// only hide for multi window, not close
|
||||
Future.delayed(Duration.zero, () {
|
||||
// hide for all window
|
||||
// note: the main window can be restored by tray icon
|
||||
Future.delayed(Duration.zero, () {
|
||||
if (widget.isMainWindow) {
|
||||
windowManager.hide();
|
||||
} else {
|
||||
WindowController.fromWindowId(windowId!).hide();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
isClose: true,
|
||||
|
||||
Reference in New Issue
Block a user