Started working on split views!

This commit is contained in:
Mauro Balades
2024-05-18 01:41:41 +02:00
parent b0536e1cb1
commit 6fd8dc1514
6 changed files with 167 additions and 46 deletions

View File

@@ -0,0 +1,68 @@
diff --git a/browser/modules/AsyncTabSwitcher.sys.mjs b/browser/modules/AsyncTabSwitcher.sys.mjs
index 9f4aa535e07adab496788165f4089be6732b1444..7b7955c0d1f2f3277cb750652458649d181e90e5 100644
--- a/browser/modules/AsyncTabSwitcher.sys.mjs
+++ b/browser/modules/AsyncTabSwitcher.sys.mjs
@@ -39,6 +39,10 @@ XPCOMUtils.defineLazyPreferenceGetter(
300
);
+function zenSplitViewIsEnabled() {
+ return Services.prefs.getBoolPref("zen.splitView.working", false);
+}
+
/**
* The tab switcher is responsible for asynchronously switching
* tabs in e10s. It waits until the new tab is ready (i.e., the
@@ -279,7 +283,7 @@ export class AsyncTabSwitcher {
browser.docShellIsActive = true;
}
- if (remoteTab) {
+ if (remoteTab && !zenSplitViewIsEnabled()) {
browser.renderLayers = true;
remoteTab.priorityHint = true;
}
@@ -291,7 +295,7 @@ export class AsyncTabSwitcher {
// Setting the docShell to be inactive will also cause it
// to stop rendering layers.
browser.docShellIsActive = false;
- if (remoteTab) {
+ if (remoteTab && !zenSplitViewIsEnabled()) {
remoteTab.priorityHint = false;
}
if (!browser.hasLayers) {
@@ -364,7 +368,7 @@ export class AsyncTabSwitcher {
// constructing BrowserChild's, layer trees, etc, by showing a blank
// tab instead and focusing it immediately.
let shouldBeBlank = false;
- if (requestedBrowser.isRemoteBrowser) {
+ if (requestedBrowser.isRemoteBrowser && !zenSplitViewIsEnabled()) {
// If a tab is remote and the window is not minimized, we can show a
// blank tab instead of a spinner in the following cases:
//
@@ -399,7 +403,7 @@ export class AsyncTabSwitcher {
}
}
- if (requestedBrowser.isRemoteBrowser) {
+ if (requestedBrowser.isRemoteBrowser && !zenSplitViewIsEnabled()) {
this.addLogFlag("isRemote");
}
@@ -825,7 +829,7 @@ export class AsyncTabSwitcher {
`onRemotenessChange(${tab._tPos}, ${tab.linkedBrowser.isRemoteBrowser})`
);
if (!tab.linkedBrowser.isRemoteBrowser) {
- if (this.getTabState(tab) == this.STATE_LOADING) {
+ if (this.getTabState(tab) == this.STATE_LOADING && !zenSplitViewIsEnabled()) {
this.onLayersReady(tab.linkedBrowser);
} else if (this.getTabState(tab) == this.STATE_UNLOADING) {
this.onLayersCleared(tab.linkedBrowser);
@@ -1018,6 +1022,7 @@ export class AsyncTabSwitcher {
lazy.gTabCacheSize > 1 &&
tab.linkedBrowser.isRemoteBrowser &&
tab.linkedBrowser.currentURI.spec != "about:blank"
+ && !zenSplitViewIsEnabled()
) {
let tabIndex = this.tabLayerCache.indexOf(tab);