mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-01-18 15:53:00 +08:00
fix: FFI id assignment && keep Remote Page state for multi tabs
Signed-off-by: Kingtous <kingtous@qq.com>
This commit is contained in:
parent
ed434fa90e
commit
330a2ce5a5
2
build.rs
2
build.rs
@ -77,7 +77,7 @@ fn gen_flutter_rust_bridge() {
|
||||
..Default::default()
|
||||
};
|
||||
// run fbr_codegen
|
||||
lib_flutter_rust_bridge_codegen::frb_codegen(opts).unwrap();
|
||||
// lib_flutter_rust_bridge_codegen::frb_codegen(opts).unwrap();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
@ -31,7 +31,8 @@ class RemotePage extends StatefulWidget {
|
||||
_RemotePageState createState() => _RemotePageState();
|
||||
}
|
||||
|
||||
class _RemotePageState extends State<RemotePage> with WindowListener {
|
||||
class _RemotePageState extends State<RemotePage>
|
||||
with WindowListener, AutomaticKeepAliveClientMixin {
|
||||
Timer? _interval;
|
||||
Timer? _timer;
|
||||
bool _showBar = !isWebDesktop;
|
||||
@ -234,6 +235,7 @@ class _RemotePageState extends State<RemotePage> with WindowListener {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
final pi = Provider.of<FfiModel>(context).pi;
|
||||
final hideKeyboard = isKeyboardShown() && _showEdit;
|
||||
final showActionButton = !_showBar || hideKeyboard;
|
||||
@ -916,6 +918,9 @@ class _RemotePageState extends State<RemotePage> with WindowListener {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
}
|
||||
|
||||
class ImagePaint extends StatelessWidget {
|
||||
|
@ -22,7 +22,7 @@ Future<Null> main(List<String> args) async {
|
||||
// global FFI, use this **ONLY** for global configuration
|
||||
// for convenience, use global FFI on mobile platform
|
||||
// focus on multi-ffi on desktop first
|
||||
initGlobalFFI();
|
||||
await initGlobalFFI();
|
||||
// await Firebase.initializeApp();
|
||||
if (isAndroid) {
|
||||
toAndroidChannelInit();
|
||||
|
@ -913,7 +913,7 @@ class FFI {
|
||||
}();
|
||||
// every instance will bind a stream
|
||||
}
|
||||
id = id;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/// Login with [password], choose if the client should [remember] it.
|
||||
@ -935,6 +935,7 @@ class FFI {
|
||||
ffiModel.clear();
|
||||
canvasModel.clear();
|
||||
resetModifiers();
|
||||
print("model closed");
|
||||
}
|
||||
|
||||
/// Send **get** command to the Rust core based on [name] and [arg].
|
||||
|
Loading…
Reference in New Issue
Block a user