Skip to content

Commit 8afd08a

Browse files
committed
fix: Fixed urlbar in double toolbar mode, b=(bug #7385), c=common
1 parent 6a21a6f commit 8afd08a

File tree

3 files changed

+26
-16
lines changed

3 files changed

+26
-16
lines changed

src/browser/components/urlbar/UrlbarInput-sys-mjs.patch

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs
2-
index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8d94bc2b7f3469258cb1a24888c5890eb83047e1 100644
2+
index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..66ef8de0d2a767376740ca57d75b5372cc11ed40 100644
33
--- a/browser/components/urlbar/UrlbarInput.sys.mjs
44
+++ b/browser/components/urlbar/UrlbarInput.sys.mjs
55
@@ -68,6 +68,13 @@ XPCOMUtils.defineLazyPreferenceGetter(
@@ -208,32 +208,36 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8d94bc2b7f3469258cb1a24888c5890e
208208
this.view.autoOpen({ event });
209209
} else {
210210
if (this._untrimOnFocusAfterKeydown) {
211-
@@ -4164,9 +4237,12 @@ export class UrlbarInput {
211+
@@ -4164,9 +4237,16 @@ export class UrlbarInput {
212212
}
213213

214214
_on_mousedown(event) {
215215
- switch (event.currentTarget) {
216216
+ switch (event.zenOriginalTarget || event.currentTarget) {
217217
case this.textbox: {
218218
this._mousedownOnUrlbarDescendant = true;
219-
+ if (event.type != "click") {
219+
+ const isProbablyFloating =
220+
+ (lazy.ZEN_URLBAR_BEHAVIOR == "floating-on-type" &&
221+
+ this.hasAttribute("breakout-extend") && !this.focusedViaMousedown) ||
222+
+ (lazy.ZEN_URLBAR_BEHAVIOR == "float") || this.window.gZenVerticalTabsManager._hasSetSingleToolbar;
223+
+ if (event.type != "click" && isProbablyFloating || event.type == "click" && !isProbablyFloating) {
220224
+ return true;
221225
+ }
222226

223227
if (
224228
event.target != this.inputField &&
225-
@@ -4176,8 +4252,8 @@ export class UrlbarInput {
226-
break;
227-
}
229+
@@ -4178,6 +4258,10 @@ export class UrlbarInput {
228230

229-
- this.focusedViaMousedown = !this.focused;
230-
- this._preventClickSelectsAll = this.focused;
231-
+ this.focusedViaMousedown = !(lazy.ZEN_URLBAR_BEHAVIOR === 'default' ? this.focused : this.hasAttribute("breakout-extend"));
232-
+ this._preventClickSelectsAll = lazy.ZEN_URLBAR_BEHAVIOR === 'default' ? this.focused : this.hasAttribute("breakout-extend");
231+
this.focusedViaMousedown = !this.focused;
232+
this._preventClickSelectsAll = this.focused;
233+
+ if (isProbablyFloating) {
234+
+ this.focusedViaMousedown = !this.hasAttribute("breakout-extend");
235+
+ this._preventClickSelectsAll = this.hasAttribute("breakout-extend");
236+
+ }
233237

234238
// Keep the focus status, since the attribute may be changed
235239
// upon calling this.focus().
236-
@@ -4218,7 +4294,7 @@ export class UrlbarInput {
240+
@@ -4218,7 +4302,7 @@ export class UrlbarInput {
237241
}
238242
// Don't close the view when clicking on a tab; we may want to keep the
239243
// view open on tab switch, and the TabSelect event arrived earlier.

src/browser/themes/shared/zen-icons/icons.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ menuitem[id='placesContext_new:separator'] {
10971097
}
10981098

10991099
#alltabs-button {
1100-
list-style-image: url("chrome://browser/skin/tabs.svg") !important;
1100+
list-style-image: url('chrome://browser/skin/tabs.svg') !important;
11011101
}
11021102

11031103
:not(:not(menubar) > menu, #ContentSelectDropdown)

src/zen/common/styles/zen-urlbar.css

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,16 @@
9595
position: relative;
9696
}
9797

98-
:root[zen-single-toolbar='true'] #urlbar:not([breakout-extend='true']) #identity-box {
99-
margin-inline-end: 0 !important;
100-
&.chromeUI:not([pageproxystate='invalid']) #identity-icon-box {
101-
border-radius: 10px !important;
98+
:root[zen-single-toolbar='true'] #urlbar:not([breakout-extend='true']) {
99+
& #urlbar-input {
100+
cursor: default;
101+
}
102+
103+
& #identity-box {
104+
margin-inline-end: 0 !important;
105+
&.chromeUI:not([pageproxystate='invalid']) #identity-icon-box {
106+
border-radius: 10px !important;
107+
}
102108
}
103109
}
104110

0 commit comments

Comments
 (0)