fix: Fixed closing last tab not closing the window and other refactors, b=closes #10455, c=common, configs, kbs, split-view, folders, tests, workspaces

This commit is contained in:
Mr. M
2025-09-21 17:29:40 +02:00
parent 2ed55a22a6
commit d962cf9949
17 changed files with 110 additions and 18 deletions

View File

@@ -1130,7 +1130,7 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
}
}
handleTabBeforeClose(tab, closeWindowWithLastTab = false) {
handleTabBeforeClose(tab, closeWindowWithLastTab) {
if (!this.workspaceEnabled || this.__contextIsDelete || this._removedByStartupPage) {
return null;
}
@@ -1144,7 +1144,8 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
let tabsPinned = tabs.filter(
(t) => !this.shouldOpenNewTabIfLastUnpinnedTabIsClosed || !t.pinned
);
const shouldCloseWindow = this.shouldCloseWindow() && closeWindowWithLastTab;
const shouldCloseWindow =
closeWindowWithLastTab != null ? closeWindowWithLastTab : this.shouldCloseWindow();
if (tabs.length === 1 && tabs[0] === tab) {
if (shouldCloseWindow) {
// We've already called beforeunload on all the relevant tabs if we get here,