|
1 | 1 | 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 |
3 | 3 | --- a/browser/components/urlbar/UrlbarInput.sys.mjs
|
4 | 4 | +++ b/browser/components/urlbar/UrlbarInput.sys.mjs
|
5 | 5 | @@ -68,6 +68,13 @@ XPCOMUtils.defineLazyPreferenceGetter(
|
@@ -208,32 +208,36 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8d94bc2b7f3469258cb1a24888c5890e
|
208 | 208 | this.view.autoOpen({ event });
|
209 | 209 | } else {
|
210 | 210 | if (this._untrimOnFocusAfterKeydown) {
|
211 |
| -@@ -4164,9 +4237,12 @@ export class UrlbarInput { |
| 211 | +@@ -4164,9 +4237,16 @@ export class UrlbarInput { |
212 | 212 | }
|
213 | 213 |
|
214 | 214 | _on_mousedown(event) {
|
215 | 215 | - switch (event.currentTarget) {
|
216 | 216 | + switch (event.zenOriginalTarget || event.currentTarget) {
|
217 | 217 | case this.textbox: {
|
218 | 218 | 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) { |
220 | 224 | + return true;
|
221 | 225 | + }
|
222 | 226 |
|
223 | 227 | if (
|
224 | 228 | event.target != this.inputField &&
|
225 |
| -@@ -4176,8 +4252,8 @@ export class UrlbarInput { |
226 |
| - break; |
227 |
| - } |
| 229 | +@@ -4178,6 +4258,10 @@ export class UrlbarInput { |
228 | 230 |
|
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 | ++ } |
233 | 237 |
|
234 | 238 | // Keep the focus status, since the attribute may be changed
|
235 | 239 | // upon calling this.focus().
|
236 |
| -@@ -4218,7 +4294,7 @@ export class UrlbarInput { |
| 240 | +@@ -4218,7 +4302,7 @@ export class UrlbarInput { |
237 | 241 | }
|
238 | 242 | // Don't close the view when clicking on a tab; we may want to keep the
|
239 | 243 | // view open on tab switch, and the TabSelect event arrived earlier.
|
|
0 commit comments