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) {
|
||||
return;
|
||||
}
|
||||
if (id == null) {
|
||||
print("Bring window on top");
|
||||
// main window
|
||||
windowManager.restore();
|
||||
windowManager.show();
|
||||
windowManager.focus();
|
||||
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.show();
|
||||
windowManager.focus();
|
||||
}
|
||||
rustDeskWinManager.registerActiveWindow(kWindowMainId);
|
||||
} else {
|
||||
WindowController.fromWindowId(id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user