cm window always on top (#7953)

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2024-05-08 12:08:37 +08:00 committed by GitHub
parent 01322146c0
commit ea3786457b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -248,7 +248,7 @@ bool _isCmReadyToShow = false;
showCmWindow({bool isStartup = false}) async {
if (isStartup) {
WindowOptions windowOptions = getHiddenTitleBarWindowOptions(
size: kConnectionManagerWindowSizeClosedChat);
size: kConnectionManagerWindowSizeClosedChat, alwaysOnTop: true);
await windowManager.waitUntilReadyToShow(windowOptions, null);
bind.mainHideDocker();
await Future.wait([
@ -342,7 +342,7 @@ void runInstallPage() async {
}
WindowOptions getHiddenTitleBarWindowOptions(
{Size? size, bool center = false}) {
{Size? size, bool center = false, bool? alwaysOnTop}) {
var defaultTitleBarStyle = TitleBarStyle.hidden;
// we do not hide titlebar on win7 because of the frame overflow.
if (kUseCompatibleUiMode) {
@ -354,6 +354,7 @@ WindowOptions getHiddenTitleBarWindowOptions(
backgroundColor: Colors.transparent,
skipTaskbar: false,
titleBarStyle: defaultTitleBarStyle,
alwaysOnTop: alwaysOnTop,
);
}