mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-01 01:21:06 +03:00
opt: ui & cursor
- opt: win7 frameless - opt: disable cursor output & macos free cache - opt: main window, set location before show/hide
This commit is contained in:
@@ -118,17 +118,20 @@ void runMainApp(bool startService) async {
|
||||
gFFI.serverModel.startService();
|
||||
}
|
||||
runApp(App());
|
||||
// restore the location of the main window before window hide or show
|
||||
await restoreWindowPosition(WindowType.Main);
|
||||
// check the startup argument, if we successfully handle the argument, we keep the main window hidden.
|
||||
if (checkArguments()) {
|
||||
windowManager.hide();
|
||||
} else {
|
||||
windowManager.show();
|
||||
windowManager.focus();
|
||||
// move registration of active main window here to prevent async visible check.
|
||||
rustDeskWinManager.registerActiveWindow(kWindowMainId);
|
||||
}
|
||||
// set window option
|
||||
WindowOptions windowOptions = getHiddenTitleBarWindowOptions();
|
||||
windowManager.waitUntilReadyToShow(windowOptions, () async {
|
||||
restoreWindowPosition(WindowType.Main);
|
||||
windowManager.setOpacity(1);
|
||||
});
|
||||
}
|
||||
@@ -173,6 +176,11 @@ void runMultiWindow(
|
||||
widget,
|
||||
MyTheme.currentThemeMode(),
|
||||
);
|
||||
// we do not hide titlebar on win7 because of the frame overflow.
|
||||
if (Platform.isWindows &&
|
||||
const [WindowsTarget.w7].contains(windowsBuildNumber.windowsVersion)) {
|
||||
WindowController.fromWindowId(windowId!).showTitleBar(true);
|
||||
}
|
||||
switch (appType) {
|
||||
case kAppTypeDesktopRemote:
|
||||
await restoreWindowPosition(WindowType.RemoteDesktop,
|
||||
@@ -273,12 +281,18 @@ void runInstallPage() async {
|
||||
}
|
||||
|
||||
WindowOptions getHiddenTitleBarWindowOptions({Size? size}) {
|
||||
var defaultTitleBarStyle = TitleBarStyle.hidden;
|
||||
// we do not hide titlebar on win7 because of the frame overflow.
|
||||
if (Platform.isWindows &&
|
||||
const [WindowsTarget.w7].contains(windowsBuildNumber.windowsVersion)) {
|
||||
defaultTitleBarStyle = TitleBarStyle.normal;
|
||||
}
|
||||
return WindowOptions(
|
||||
size: size,
|
||||
center: false,
|
||||
backgroundColor: Colors.transparent,
|
||||
skipTaskbar: false,
|
||||
titleBarStyle: TitleBarStyle.hidden,
|
||||
titleBarStyle: defaultTitleBarStyle,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user