mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-07 02:16:36 +00:00
fix: Fixed omnibox not appearing on fullscreen, b=closes #5229, c=common
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs
|
diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs
|
||||||
index 1c447bd31de854d1522dbcfb5d7ad557c84f1388..1dc520f63b240cccda7be074346d2079774eed27 100644
|
index 1c447bd31de854d1522dbcfb5d7ad557c84f1388..b63bf54956a42c63d5cadc9360545e235161f625 100644
|
||||||
--- a/browser/components/urlbar/UrlbarInput.sys.mjs
|
--- a/browser/components/urlbar/UrlbarInput.sys.mjs
|
||||||
+++ b/browser/components/urlbar/UrlbarInput.sys.mjs
|
+++ b/browser/components/urlbar/UrlbarInput.sys.mjs
|
||||||
@@ -74,6 +74,13 @@ ChromeUtils.defineLazyGetter(lazy, "logger", () =>
|
@@ -74,6 +74,13 @@ ChromeUtils.defineLazyGetter(lazy, "logger", () =>
|
||||||
@@ -75,11 +75,25 @@ index 1c447bd31de854d1522dbcfb5d7ad557c84f1388..1dc520f63b240cccda7be074346d2079
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isCanonized) {
|
if (isCanonized) {
|
||||||
@@ -2205,6 +2237,12 @@ export class UrlbarInput {
|
@@ -2191,6 +2223,13 @@ export class UrlbarInput {
|
||||||
|
await this.#updateLayoutBreakoutDimensions();
|
||||||
|
}
|
||||||
|
|
||||||
|
+ get zenUrlbarBehavior() {
|
||||||
|
+ if (this.document.documentElement.hasAttribute("inDOMFullscreen")) {
|
||||||
|
+ return "float";
|
||||||
|
+ }
|
||||||
|
+ return lazy.ZEN_URLBAR_BEHAVIOR;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
startLayoutExtend() {
|
||||||
|
if (!this.#allowBreakout || this.hasAttribute("breakout-extend")) {
|
||||||
|
// Do not expand if the Urlbar does not support being expanded or it is
|
||||||
|
@@ -2205,6 +2244,12 @@ export class UrlbarInput {
|
||||||
|
|
||||||
this.setAttribute("breakout-extend", "true");
|
this.setAttribute("breakout-extend", "true");
|
||||||
|
|
||||||
+ if (lazy.ZEN_URLBAR_BEHAVIOR == 'float' || (lazy.ZEN_URLBAR_BEHAVIOR == 'floating-on-type' && !this.focusedViaMousedown)) {
|
+ if (this.zenUrlbarBehavior == 'float' || (this.zenUrlbarBehavior == 'floating-on-type' && !this.focusedViaMousedown)) {
|
||||||
+ this.setAttribute("zen-floating-urlbar", "true");
|
+ this.setAttribute("zen-floating-urlbar", "true");
|
||||||
+ this.window.gZenUIManager.onFloatingURLBarOpen();
|
+ this.window.gZenUIManager.onFloatingURLBarOpen();
|
||||||
+ } else {
|
+ } else {
|
||||||
@@ -88,7 +102,7 @@ index 1c447bd31de854d1522dbcfb5d7ad557c84f1388..1dc520f63b240cccda7be074346d2079
|
|||||||
// Enable the animation only after the first extend call to ensure it
|
// Enable the animation only after the first extend call to ensure it
|
||||||
// doesn't run when opening a new window.
|
// doesn't run when opening a new window.
|
||||||
if (!this.hasAttribute("breakout-extend-animate")) {
|
if (!this.hasAttribute("breakout-extend-animate")) {
|
||||||
@@ -2224,6 +2262,24 @@ export class UrlbarInput {
|
@@ -2224,6 +2269,24 @@ export class UrlbarInput {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,7 +127,7 @@ index 1c447bd31de854d1522dbcfb5d7ad557c84f1388..1dc520f63b240cccda7be074346d2079
|
|||||||
this.removeAttribute("breakout-extend");
|
this.removeAttribute("breakout-extend");
|
||||||
this.#updateTextboxPosition();
|
this.#updateTextboxPosition();
|
||||||
}
|
}
|
||||||
@@ -2553,7 +2609,7 @@ export class UrlbarInput {
|
@@ -2553,7 +2616,7 @@ export class UrlbarInput {
|
||||||
|
|
||||||
this.textbox.parentNode.style.setProperty(
|
this.textbox.parentNode.style.setProperty(
|
||||||
"--urlbar-container-height",
|
"--urlbar-container-height",
|
||||||
@@ -122,7 +136,7 @@ index 1c447bd31de854d1522dbcfb5d7ad557c84f1388..1dc520f63b240cccda7be074346d2079
|
|||||||
);
|
);
|
||||||
this.textbox.style.setProperty(
|
this.textbox.style.setProperty(
|
||||||
"--urlbar-height",
|
"--urlbar-height",
|
||||||
@@ -2986,6 +3042,7 @@ export class UrlbarInput {
|
@@ -2986,6 +3049,7 @@ export class UrlbarInput {
|
||||||
}
|
}
|
||||||
|
|
||||||
_toggleActionOverride(event) {
|
_toggleActionOverride(event) {
|
||||||
@@ -130,7 +144,7 @@ index 1c447bd31de854d1522dbcfb5d7ad557c84f1388..1dc520f63b240cccda7be074346d2079
|
|||||||
if (
|
if (
|
||||||
event.keyCode == KeyEvent.DOM_VK_SHIFT ||
|
event.keyCode == KeyEvent.DOM_VK_SHIFT ||
|
||||||
event.keyCode == KeyEvent.DOM_VK_ALT ||
|
event.keyCode == KeyEvent.DOM_VK_ALT ||
|
||||||
@@ -3087,7 +3144,7 @@ export class UrlbarInput {
|
@@ -3087,7 +3151,7 @@ export class UrlbarInput {
|
||||||
*/
|
*/
|
||||||
_trimValue(val) {
|
_trimValue(val) {
|
||||||
let trimmedValue = lazy.UrlbarPrefs.get("trimURLs")
|
let trimmedValue = lazy.UrlbarPrefs.get("trimURLs")
|
||||||
@@ -139,7 +153,7 @@ index 1c447bd31de854d1522dbcfb5d7ad557c84f1388..1dc520f63b240cccda7be074346d2079
|
|||||||
: val;
|
: val;
|
||||||
// Only trim value if the directionality doesn't change to RTL and we're not
|
// Only trim value if the directionality doesn't change to RTL and we're not
|
||||||
// showing a strikeout https protocol.
|
// showing a strikeout https protocol.
|
||||||
@@ -3303,6 +3360,7 @@ export class UrlbarInput {
|
@@ -3303,6 +3367,7 @@ export class UrlbarInput {
|
||||||
resultDetails = null,
|
resultDetails = null,
|
||||||
browser = this.window.gBrowser.selectedBrowser
|
browser = this.window.gBrowser.selectedBrowser
|
||||||
) {
|
) {
|
||||||
@@ -147,7 +161,7 @@ index 1c447bd31de854d1522dbcfb5d7ad557c84f1388..1dc520f63b240cccda7be074346d2079
|
|||||||
// No point in setting these because we'll handleRevert() a few rows below.
|
// No point in setting these because we'll handleRevert() a few rows below.
|
||||||
if (openUILinkWhere == "current") {
|
if (openUILinkWhere == "current") {
|
||||||
// Make sure URL is formatted properly (don't show punycode).
|
// Make sure URL is formatted properly (don't show punycode).
|
||||||
@@ -3455,6 +3513,10 @@ export class UrlbarInput {
|
@@ -3455,6 +3520,10 @@ export class UrlbarInput {
|
||||||
}
|
}
|
||||||
reuseEmpty = true;
|
reuseEmpty = true;
|
||||||
}
|
}
|
||||||
@@ -158,7 +172,7 @@ index 1c447bd31de854d1522dbcfb5d7ad557c84f1388..1dc520f63b240cccda7be074346d2079
|
|||||||
if (
|
if (
|
||||||
where == "tab" &&
|
where == "tab" &&
|
||||||
reuseEmpty &&
|
reuseEmpty &&
|
||||||
@@ -3462,6 +3524,9 @@ export class UrlbarInput {
|
@@ -3462,6 +3531,9 @@ export class UrlbarInput {
|
||||||
) {
|
) {
|
||||||
where = "current";
|
where = "current";
|
||||||
}
|
}
|
||||||
@@ -168,7 +182,7 @@ index 1c447bd31de854d1522dbcfb5d7ad557c84f1388..1dc520f63b240cccda7be074346d2079
|
|||||||
return where;
|
return where;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3719,6 +3784,7 @@ export class UrlbarInput {
|
@@ -3719,6 +3791,7 @@ export class UrlbarInput {
|
||||||
this.setResultForCurrentValue(null);
|
this.setResultForCurrentValue(null);
|
||||||
this.handleCommand();
|
this.handleCommand();
|
||||||
this.controller.clearLastQueryContextCache();
|
this.controller.clearLastQueryContextCache();
|
||||||
@@ -176,7 +190,7 @@ index 1c447bd31de854d1522dbcfb5d7ad557c84f1388..1dc520f63b240cccda7be074346d2079
|
|||||||
|
|
||||||
this._suppressStartQuery = false;
|
this._suppressStartQuery = false;
|
||||||
});
|
});
|
||||||
@@ -3726,7 +3792,6 @@ export class UrlbarInput {
|
@@ -3726,7 +3799,6 @@ export class UrlbarInput {
|
||||||
contextMenu.addEventListener("popupshowing", () => {
|
contextMenu.addEventListener("popupshowing", () => {
|
||||||
// Close the results pane when the input field contextual menu is open,
|
// Close the results pane when the input field contextual menu is open,
|
||||||
// because paste and go doesn't want a result selection.
|
// because paste and go doesn't want a result selection.
|
||||||
@@ -184,7 +198,7 @@ index 1c447bd31de854d1522dbcfb5d7ad557c84f1388..1dc520f63b240cccda7be074346d2079
|
|||||||
|
|
||||||
let controller =
|
let controller =
|
||||||
this.document.commandDispatcher.getControllerForCommand("cmd_paste");
|
this.document.commandDispatcher.getControllerForCommand("cmd_paste");
|
||||||
@@ -3836,7 +3901,11 @@ export class UrlbarInput {
|
@@ -3836,7 +3908,11 @@ export class UrlbarInput {
|
||||||
if (!engineName && !source && !this.hasAttribute("searchmode")) {
|
if (!engineName && !source && !this.hasAttribute("searchmode")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -197,7 +211,7 @@ index 1c447bd31de854d1522dbcfb5d7ad557c84f1388..1dc520f63b240cccda7be074346d2079
|
|||||||
this._searchModeIndicatorTitle.textContent = "";
|
this._searchModeIndicatorTitle.textContent = "";
|
||||||
this._searchModeIndicatorTitle.removeAttribute("data-l10n-id");
|
this._searchModeIndicatorTitle.removeAttribute("data-l10n-id");
|
||||||
|
|
||||||
@@ -4130,6 +4199,7 @@ export class UrlbarInput {
|
@@ -4130,6 +4206,7 @@ export class UrlbarInput {
|
||||||
|
|
||||||
this.document.l10n.setAttributes(
|
this.document.l10n.setAttributes(
|
||||||
this.inputField,
|
this.inputField,
|
||||||
@@ -205,7 +219,7 @@ index 1c447bd31de854d1522dbcfb5d7ad557c84f1388..1dc520f63b240cccda7be074346d2079
|
|||||||
l10nId,
|
l10nId,
|
||||||
l10nId == "urlbar-placeholder-with-name" ? { name } : undefined
|
l10nId == "urlbar-placeholder-with-name" ? { name } : undefined
|
||||||
);
|
);
|
||||||
@@ -4241,6 +4311,11 @@ export class UrlbarInput {
|
@@ -4241,6 +4318,11 @@ export class UrlbarInput {
|
||||||
}
|
}
|
||||||
|
|
||||||
_on_click(event) {
|
_on_click(event) {
|
||||||
@@ -217,7 +231,7 @@ index 1c447bd31de854d1522dbcfb5d7ad557c84f1388..1dc520f63b240cccda7be074346d2079
|
|||||||
if (
|
if (
|
||||||
event.target == this.inputField ||
|
event.target == this.inputField ||
|
||||||
event.target == this._inputContainer
|
event.target == this._inputContainer
|
||||||
@@ -4311,7 +4386,7 @@ export class UrlbarInput {
|
@@ -4311,7 +4393,7 @@ export class UrlbarInput {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,7 +240,7 @@ index 1c447bd31de854d1522dbcfb5d7ad557c84f1388..1dc520f63b240cccda7be074346d2079
|
|||||||
this.view.autoOpen({ event });
|
this.view.autoOpen({ event });
|
||||||
} else {
|
} else {
|
||||||
if (this._untrimOnFocusAfterKeydown) {
|
if (this._untrimOnFocusAfterKeydown) {
|
||||||
@@ -4351,9 +4426,16 @@ export class UrlbarInput {
|
@@ -4351,9 +4433,16 @@ export class UrlbarInput {
|
||||||
}
|
}
|
||||||
|
|
||||||
_on_mousedown(event) {
|
_on_mousedown(event) {
|
||||||
@@ -235,16 +249,16 @@ index 1c447bd31de854d1522dbcfb5d7ad557c84f1388..1dc520f63b240cccda7be074346d2079
|
|||||||
case this.textbox: {
|
case this.textbox: {
|
||||||
this._mousedownOnUrlbarDescendant = true;
|
this._mousedownOnUrlbarDescendant = true;
|
||||||
+ const isProbablyFloating =
|
+ const isProbablyFloating =
|
||||||
+ (lazy.ZEN_URLBAR_BEHAVIOR == "floating-on-type" &&
|
+ (this.zenUrlbarBehavior == "floating-on-type" &&
|
||||||
+ this.hasAttribute("breakout-extend") && !this.focusedViaMousedown) ||
|
+ this.hasAttribute("breakout-extend") && !this.focusedViaMousedown) ||
|
||||||
+ (lazy.ZEN_URLBAR_BEHAVIOR == "float") || this.window.gZenVerticalTabsManager._hasSetSingleToolbar;
|
+ (this.zenUrlbarBehavior == "float") || this.window.gZenVerticalTabsManager._hasSetSingleToolbar;
|
||||||
+ if (event.type != "click" && isProbablyFloating || event.type == "click" && !isProbablyFloating) {
|
+ if (event.type != "click" && isProbablyFloating || event.type == "click" && !isProbablyFloating) {
|
||||||
+ return true;
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
|
|
||||||
if (
|
if (
|
||||||
event.target != this.inputField &&
|
event.target != this.inputField &&
|
||||||
@@ -4364,6 +4446,10 @@ export class UrlbarInput {
|
@@ -4364,6 +4453,10 @@ export class UrlbarInput {
|
||||||
|
|
||||||
this.focusedViaMousedown = !this.focused;
|
this.focusedViaMousedown = !this.focused;
|
||||||
this._preventClickSelectsAll = this.focused;
|
this._preventClickSelectsAll = this.focused;
|
||||||
@@ -255,7 +269,7 @@ index 1c447bd31de854d1522dbcfb5d7ad557c84f1388..1dc520f63b240cccda7be074346d2079
|
|||||||
|
|
||||||
// Keep the focus status, since the attribute may be changed
|
// Keep the focus status, since the attribute may be changed
|
||||||
// upon calling this.focus().
|
// upon calling this.focus().
|
||||||
@@ -4399,7 +4485,7 @@ export class UrlbarInput {
|
@@ -4399,7 +4492,7 @@ export class UrlbarInput {
|
||||||
}
|
}
|
||||||
// Don't close the view when clicking on a tab; we may want to keep the
|
// Don't close the view when clicking on a tab; we may want to keep the
|
||||||
// view open on tab switch, and the TabSelect event arrived earlier.
|
// view open on tab switch, and the TabSelect event arrived earlier.
|
||||||
@@ -264,7 +278,7 @@ index 1c447bd31de854d1522dbcfb5d7ad557c84f1388..1dc520f63b240cccda7be074346d2079
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4716,7 +4802,7 @@ export class UrlbarInput {
|
@@ -4716,7 +4809,7 @@ export class UrlbarInput {
|
||||||
// When we are in actions search mode we can show more results so
|
// When we are in actions search mode we can show more results so
|
||||||
// increase the limit.
|
// increase the limit.
|
||||||
let maxResults =
|
let maxResults =
|
||||||
|
@@ -29,6 +29,8 @@
|
|||||||
|
|
||||||
&[breakout-extend='true'] {
|
&[breakout-extend='true'] {
|
||||||
--urlbar-container-padding: 0px;
|
--urlbar-container-padding: 0px;
|
||||||
|
/* See issue https://github.com/zen-browser/desktop/issues/5229 */
|
||||||
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
:root[zen-single-toolbar='true'] &[breakout-extend='true'],
|
:root[zen-single-toolbar='true'] &[breakout-extend='true'],
|
||||||
|
Reference in New Issue
Block a user