fix: macos, terminate, close main then remote windows (#8240)
* fix: macos, terminate, close main then remote windows Signed-off-by: fufesou <linlong1266@gmail.com> * comments Signed-off-by: fufesou <linlong1266@gmail.com> --------- Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
parent
b6ebf61d6c
commit
32346c23e0
@ -2384,7 +2384,13 @@ Future<void> onActiveWindowChanged() async {
|
|||||||
await windowManager.setPreventClose(false);
|
await windowManager.setPreventClose(false);
|
||||||
await windowManager.close();
|
await windowManager.close();
|
||||||
if (isMacOS) {
|
if (isMacOS) {
|
||||||
|
// If we call without delay, `flutter/macos/Runner/MainFlutterWindow.swift` can handle the "terminate" event.
|
||||||
|
// But the app will not close.
|
||||||
|
//
|
||||||
|
// No idea why we need to delay here, `terminate()` itself is also an async function.
|
||||||
|
Future.delayed(Duration.zero, () {
|
||||||
RdPlatformChannel.instance.terminate();
|
RdPlatformChannel.instance.terminate();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user