Revert "not accept dialog show when desktop page dispose"

This commit is contained in:
RustDesk
2023-06-08 16:42:57 +08:00
committed by GitHub
Unverified
parent b18f1a719b
commit efd50ef4f6
4 changed files with 4 additions and 9 deletions

View File

@@ -600,16 +600,12 @@ class OverlayDialogManager {
int _tagCount = 0;
OverlayEntry? _mobileActionsOverlayEntry;
bool _stop = false;
void setOverlayState(OverlayKeyState overlayKeyState) {
_overlayKeyState = overlayKeyState;
}
void dismissAll({bool? stop}) {
if (stop != null) {
_stop = stop;
}
void dismissAll() {
_dialogs.forEach((key, value) {
value.complete(null);
BackButtonInterceptor.removeByName(key);
@@ -629,7 +625,6 @@ class OverlayDialogManager {
String? tag,
bool useAnimation = true,
bool forceGlobal = false}) {
if (_stop) return Future(() => null);
final overlayState =
forceGlobal ? globalKey.currentState?.overlay : _overlayKeyState.state;

View File

@@ -97,7 +97,7 @@ class _FileManagerPageState extends State<FileManagerPage>
void dispose() {
model.close().whenComplete(() {
_ffi.close();
_ffi.dialogManager.dismissAll(stop: true);
_ffi.dialogManager.dismissAll();
if (!Platform.isLinux) {
Wakelock.disable();
}

View File

@@ -70,7 +70,7 @@ class _PortForwardPageState extends State<PortForwardPage>
@override
void dispose() {
_ffi.close();
_ffi.dialogManager.dismissAll(stop: true);
_ffi.dialogManager.dismissAll();
if (!Platform.isLinux) {
Wakelock.disable();
}

View File

@@ -220,7 +220,7 @@ class _RemotePageState extends State<RemotePage>
_rawKeyFocusNode.dispose();
_ffi.close();
_timer?.cancel();
_ffi.dialogManager.dismissAll(stop: true);
_ffi.dialogManager.dismissAll();
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
overlays: SystemUiOverlay.values);
if (!Platform.isLinux) {