Attempt to fix arrow keys not working after opening the extensions panel (https://github.com/zen-browser/desktop/issues/2743)

This commit is contained in:
mr. M
2024-12-23 16:58:52 +01:00
parent 0f1101bf06
commit 1f1630dc65

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs
index c504c9afc43785b5f003bb1f9f1dfbddef38d78b..b8acf033b211b18ff5114a81648483abf165be51 100644
index c504c9afc43785b5f003bb1f9f1dfbddef38d78b..986c629b88b635a71bd795bd115b9a72a3481500 100644
--- a/browser/components/urlbar/UrlbarInput.sys.mjs
+++ b/browser/components/urlbar/UrlbarInput.sys.mjs
@@ -65,6 +65,13 @@ XPCOMUtils.defineLazyPreferenceGetter(
@@ -16,18 +16,26 @@ index c504c9afc43785b5f003bb1f9f1dfbddef38d78b..b8acf033b211b18ff5114a81648483ab
const DEFAULT_FORM_HISTORY_NAME = "searchbar-history";
const SEARCH_BUTTON_CLASS = "urlbar-search-button";
@@ -2154,6 +2161,10 @@ export class UrlbarInput {
@@ -2154,6 +2161,18 @@ export class UrlbarInput {
this.setAttribute("breakout-extend", "true");
+ if (lazy.ZEN_URLBAR_BEHAVIOR == 'float' || (lazy.ZEN_URLBAR_BEHAVIOR == 'floating-on-type' && !this.focusedViaMousedown)) {
+ this.setAttribute("zen-floating-urlbar", "true");
+ } else this.removeAttribute("zen-floating-urlbar");
+ if (lazy.UrlbarPrefs.get("closeOtherPanelsOnOpen")) {
+ setTimeout(() => {
+ this.window.docShell.treeOwner
+ .QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIAppWindow)
+ .rollupAllPopups();
+ });
+ }
+
// Enable the animation only after the first extend call to ensure it
// doesn't run when opening a new window.
if (!this.hasAttribute("breakout-extend-animate")) {
@@ -3901,6 +3912,11 @@ export class UrlbarInput {
@@ -3901,6 +3920,11 @@ export class UrlbarInput {
}
_on_click(event) {
@@ -39,7 +47,7 @@ index c504c9afc43785b5f003bb1f9f1dfbddef38d78b..b8acf033b211b18ff5114a81648483ab
if (
event.target == this.inputField ||
event.target == this._inputContainer ||
@@ -4012,9 +4028,12 @@ export class UrlbarInput {
@@ -4012,9 +4036,12 @@ export class UrlbarInput {
}
_on_mousedown(event) {
@@ -53,7 +61,7 @@ index c504c9afc43785b5f003bb1f9f1dfbddef38d78b..b8acf033b211b18ff5114a81648483ab
if (
event.target != this.inputField &&
@@ -4024,8 +4043,8 @@ export class UrlbarInput {
@@ -4024,8 +4051,8 @@ export class UrlbarInput {
break;
}