mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 11:06:57 +00:00
opt: add preventClose to handle close event manually
This commit is contained in:
@@ -166,6 +166,7 @@ class RustDeskMultiWindowManager {
|
||||
// no such window already
|
||||
return;
|
||||
}
|
||||
await WindowController.fromWindowId(wId).setPreventClose(false);
|
||||
await WindowController.fromWindowId(wId).close();
|
||||
} on Error {
|
||||
return;
|
||||
@@ -206,6 +207,12 @@ class RustDeskMultiWindowManager {
|
||||
|
||||
}
|
||||
|
||||
/// Remove active window which has [`windowId`]
|
||||
///
|
||||
/// [Avaliability]
|
||||
/// This function should only be called from main window.
|
||||
/// For other windows, please post a unregister(hide) event to main window handler:
|
||||
/// `rustDeskWinManager.call(WindowType.Main, kWindowEventHide, {"id": windowId!});`
|
||||
void unregisterActiveWindow(int windowId) {
|
||||
if (!_activeWindows.contains(windowId)) {
|
||||
// ignore
|
||||
|
||||
Reference in New Issue
Block a user