forked from ZenBrowserMirrors/zen-desktop
fix: Fixed glance freezing when opening tabs in other worksaces, b=(bug #7864), c=glance, workspaces
This commit is contained in:
parent
0890180889
commit
2365fa9fbc
2 changed files with 14 additions and 4 deletions
|
@ -645,6 +645,16 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
getTabOrGlanceParent(tab) {
|
||||
if (tab.hasAttribute('glance-id')) {
|
||||
const parentTab = this.#glances.get(tab.getAttribute('glance-id')).parentTab;
|
||||
if (parentTab) {
|
||||
return parentTab;
|
||||
}
|
||||
}
|
||||
return tab;
|
||||
}
|
||||
}
|
||||
|
||||
window.gZenGlanceManager = new ZenGlanceManager();
|
||||
|
|
|
@ -2162,7 +2162,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||
|
||||
// Save current tab as last selected for old workspace if it shouldn't be visible in new workspace
|
||||
if (oldWorkspaceId && oldWorkspaceId !== window.uuid) {
|
||||
this._lastSelectedWorkspaceTabs[oldWorkspaceId] = currentSelectedTab;
|
||||
this._lastSelectedWorkspaceTabs[oldWorkspaceId] = gZenGlanceManager.getTabOrGlanceParent(currentSelectedTab);
|
||||
}
|
||||
|
||||
let tabToSelect = null;
|
||||
|
@ -2400,7 +2400,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||
|
||||
if (workspaceID) {
|
||||
if (tab.hasAttribute('change-workspace') && this.moveTabToWorkspace(tab, workspaceID)) {
|
||||
this._lastSelectedWorkspaceTabs[workspaceID] = tab;
|
||||
this._lastSelectedWorkspaceTabs[workspaceID] = gZenGlanceManager.getTabOrGlanceParent(tab);
|
||||
tab.removeAttribute('change-workspace');
|
||||
await this.changeWorkspace({ uuid: workspaceID, containerTabId: tab.getAttribute('usercontextid') }, { onInit: true });
|
||||
}
|
||||
|
@ -2441,7 +2441,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||
|
||||
// Only update last selected tab for non-essential tabs in their workspace
|
||||
if (workspaceID === activeWorkspace.uuid) {
|
||||
this._lastSelectedWorkspaceTabs[workspaceID] = tab;
|
||||
this._lastSelectedWorkspaceTabs[workspaceID] = gZenGlanceManager.getTabOrGlanceParent(tab);
|
||||
}
|
||||
|
||||
// Switch workspace if needed
|
||||
|
@ -2623,7 +2623,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||
}
|
||||
}
|
||||
// Make sure we select the last tab in the new workspace
|
||||
this._lastSelectedWorkspaceTabs[workspaceID] = tabs[tabs.length - 1];
|
||||
this._lastSelectedWorkspaceTabs[workspaceID] = gZenGlanceManager.getTabOrGlanceParent(tabs[tabs.length - 1]);
|
||||
const workspaces = await this._workspaces();
|
||||
await this.changeWorkspace(workspaces.workspaces.find((workspace) => workspace.uuid === workspaceID));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue