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
1 changed files with 13 additions and 4 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue