Merge remote-tracking branch 'upstream/master' into file-manager-redesign

This commit is contained in:
NicKoehler
2023-02-22 23:01:31 +01:00
parent 922a70adb4
commit 12a33cdfbb
31 changed files with 488 additions and 282 deletions

View File

@@ -14,6 +14,7 @@ import 'package:flutter_hbb/desktop/pages/desktop_tab_page.dart';
import 'package:flutter_hbb/desktop/widgets/scroll_wrapper.dart';
import 'package:flutter_hbb/models/platform_model.dart';
import 'package:flutter_hbb/models/server_model.dart';
import 'package:flutter_hbb/models/state_model.dart';
import 'package:flutter_hbb/utils/multi_window_manager.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
@@ -498,6 +499,10 @@ class _DesktopHomePageState extends State<DesktopHomePage>
if (watchIsInputMonitoring) {
if (bind.mainIsCanInputMonitoring(prompt: false)) {
watchIsInputMonitoring = false;
// Do not notify for now.
// Monitoring may not take effect until the process is restarted.
// rustDeskWinManager.call(
// WindowType.RemoteDesktop, kWindowDisableGrabKeyboard, '');
setState(() {});
}
}

View File

@@ -111,6 +111,8 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
forceRelay: args['forceRelay'],
),
));
} else if (call.method == kWindowDisableGrabKeyboard) {
stateGlobal.grabKeyboard = false;
} else if (call.method == "onDestroy") {
tabController.clear();
} else if (call.method == kWindowActionRebuild) {

View File

@@ -650,6 +650,12 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
}
Widget _buildKeyboard(BuildContext context) {
// Do not support peer 1.1.9.
if (stateGlobal.grabKeyboard) {
bind.sessionSetKeyboardMode(id: widget.id, value: 'map');
return Offstage();
}
FfiModel ffiModel = Provider.of<FfiModel>(context);
if (ffiModel.permissions['keyboard'] == false) {
return Offstage();

View File

@@ -548,13 +548,20 @@ class WindowActionPanelState extends State<WindowActionPanel>
if (rustDeskWinManager.getActiveWindows().contains(kMainWindowId)) {
await rustDeskWinManager.unregisterActiveWindow(kMainWindowId);
}
// `hide` must be placed after unregisterActiveWindow, because once all windows are hidden,
// flutter closes the application on macOS. We should ensure the post-run logic has ran successfully.
// e.g.: saving window position.
// macOS specific workaround, the window is not hiding when in fullscreen.
if (Platform.isMacOS && await windowManager.isFullScreen()) {
await windowManager.setFullScreen(false);
await Future.delayed(Duration(seconds: 1));
}
await windowManager.hide();
} else {
// it's safe to hide the subwindow
await WindowController.fromWindowId(kWindowId!).hide();
final controller = WindowController.fromWindowId(kWindowId!);
if (Platform.isMacOS && await controller.isFullScreen()) {
await controller.setFullscreen(false);
await Future.delayed(Duration(seconds: 1));
}
await controller.hide();
await Future.wait([
rustDeskWinManager
.call(WindowType.Main, kWindowEventHide, {"id": kWindowId!}),