fix cm window_on_top when behind other window
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
parent
5cef21fd40
commit
769e46d3e6
@ -545,16 +545,25 @@ closeConnection({String? id}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void window_on_top(int? id) {
|
void window_on_top(int? id) async {
|
||||||
if (!isDesktop) {
|
if (!isDesktop) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (id == null) {
|
if (id == null) {
|
||||||
print("Bring window on top");
|
print("Bring window on top");
|
||||||
// main window
|
// main window
|
||||||
|
if (desktopType == DesktopType.cm &&
|
||||||
|
!(await windowManager.isMinimized() ||
|
||||||
|
!await windowManager.isVisible())) {
|
||||||
|
await windowManager.setAlwaysOnTop(true);
|
||||||
|
Future.delayed(Duration(microseconds: 500), () async {
|
||||||
|
windowManager.setAlwaysOnTop(false);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
windowManager.restore();
|
windowManager.restore();
|
||||||
windowManager.show();
|
windowManager.show();
|
||||||
windowManager.focus();
|
windowManager.focus();
|
||||||
|
}
|
||||||
rustDeskWinManager.registerActiveWindow(kWindowMainId);
|
rustDeskWinManager.registerActiveWindow(kWindowMainId);
|
||||||
} else {
|
} else {
|
||||||
WindowController.fromWindowId(id)
|
WindowController.fromWindowId(id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user