Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

fix, dialog blocks tabs on the remote page

fufesou17285720f1b8
diff --git a/flutter/lib/desktop/pages/remote_page.dart b/flutter/lib/desktop/pages/remote_page.dart
index cb9cf49c9..6d0ba09cd 100644
--- a/flutter/lib/desktop/pages/remote_page.dart
+++ b/flutter/lib/desktop/pages/remote_page.dart
@@ -80,7 +80,7 @@ class _RemotePageState extends State<RemotePage>
late RxBool _keyboardEnabled;
final Map<int, RenderTexture> _renderTextures = {};
- final _blockableOverlayState = BlockableOverlayState();
+ var _blockableOverlayState = BlockableOverlayState();
final FocusNode _rawKeyFocusNode = FocusNode(debugLabel: "rawkeyFocusNode");
@@ -253,9 +253,9 @@ class _RemotePageState extends State<RemotePage>
onEnterOrLeaveImageCleaner: () => _onEnterOrLeaveImage4Toolbar = null,
setRemoteState: setState,
);
- return Scaffold(
- backgroundColor: Theme.of(context).colorScheme.background,
- body: Stack(
+
+ bodyWidget() {
+ return Stack(
children: [
Container(
color: Colors.black,
@@ -281,7 +281,7 @@ class _RemotePageState extends State<RemotePage>
},
inputModel: _ffi.inputModel,
child: getBodyForDesktop(context))),
- Obx(() => Stack(
+ Stack(
children: [
_ffi.ffiModel.pi.isSet.isTrue &&
_ffi.ffiModel.waitForFirstImage.isTrue
@@ -298,9 +298,34 @@ class _RemotePageState extends State<RemotePage>
: remoteToolbar(context),
_ffi.ffiModel.pi.isSet.isFalse ? emptyOverlay() : Offstage(),
],
- )),
+ ),
],
- ),
+ );
+ }
+
+ return Scaffold(
+ backgroundColor: Theme.of(context).colorScheme.background,
+ body: Obx(() {
+ final imageReady = _ffi.ffiModel.pi.isSet.isTrue &&
+ _ffi.ffiModel.waitForFirstImage.isFalse;
+ if (imageReady) {
+ // dismissAll() is ensure the state is clean.
+ // It's ok to call dismissAll() here.
+ _ffi.dialogManager.dismissAll();
+ // Recreate the block state to refresh the state.
+ _blockableOverlayState = BlockableOverlayState();
+ _blockableOverlayState.applyFfi(_ffi);
+ // Block the whole bodyWidget() when dialog shows.
+ return BlockableOverlay(
+ underlying: bodyWidget(),
+ state: _blockableOverlayState,
+ );
+ } else {
+ // _blockableOverlayState is not recreated here.
+ // The block state for the toolbar will not work on reconnecting, but it's ok.
+ return bodyWidget();
+ }
+ }),
);
}
diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs
index 9661aa8b3..1484d2440 100644
--- a/src/flutter_ffi.rs
+++ b/src/flutter_ffi.rs
@@ -210,6 +210,7 @@ pub fn session_reconnect(session_id: SessionID, force_relay: bool) {
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
session.reconnect(force_relay);
}
+ session_on_waiting_for_image_dialog_show(session_id);
}
pub fn session_toggle_option(session_id: SessionID, value: String) {