[Firefox on Linux] Fixed detached window UI gets closed when its decoration is clicked (thanks richard for reporting).

This commit is contained in:
hackademix 2023-02-27 19:17:47 +01:00
parent 4e03aa9eef
commit d1e8ec339a
No known key found for this signature in database
GPG Key ID: 231A83AFDA9C2434
1 changed files with 8 additions and 1 deletions

View File

@ -69,7 +69,14 @@ addEventListener("unload", e => {
} catch (e) {
close();
}
addEventListener("blur", close);
if (browser.windows) {
const myWinId = (await browser.windows.getCurrent()).id;
browser.windows.onFocusChanged.addListener(windowId => {
if (windowId !== browser.windows.WINDOW_ID_NONE && myWinId !== windowId) {
close();
}
});
}
} else {
tabId = tab.id;
}