Skip to content

Commit

Permalink
Always fire the popup hidden event for customizable UI popups (#2743)
Browse files Browse the repository at this point in the history
  • Loading branch information
mauro-balades committed Dec 23, 2024
1 parent 40af655 commit dd88086
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ export class ZenGlanceChild extends JSWindowActorChild {

async handleMouseDown(event) {
const target = event.target.closest('A');
console.log('target', target);
if (!target) {
return;
}
Expand Down
13 changes: 13 additions & 0 deletions src/browser/components/customizableui/content/panelUI-js.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/browser/components/customizableui/content/panelUI.js b/browser/components/customizableui/content/panelUI.js
index 1805bad6c58e060533f634ed9e511c05cad3ded1..4eb04f3eb1b9dd1c5d663cca0a7ad903b38c4efd 100644
--- a/browser/components/customizableui/content/panelUI.js
+++ b/browser/components/customizableui/content/panelUI.js
@@ -545,7 +545,7 @@ const PanelUI = {

if (viewShown) {
CustomizableUI.addPanelCloseListeners(tempPanel);
- tempPanel.addEventListener("popuphidden", panelRemover);
+ tempPanel.addEventListener("popuphidden", panelRemover, { capture: true });
} else {
panelRemover();
}
19 changes: 5 additions & 14 deletions src/browser/components/urlbar/UrlbarInput-sys-mjs.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs
index c504c9afc43785b5f003bb1f9f1dfbddef38d78b..986c629b88b635a71bd795bd115b9a72a3481500 100644
index c504c9afc43785b5f003bb1f9f1dfbddef38d78b..b08cb1d9fee5f76070c70ea928209b15b6146cb3 100644
--- a/browser/components/urlbar/UrlbarInput.sys.mjs
+++ b/browser/components/urlbar/UrlbarInput.sys.mjs
@@ -65,6 +65,13 @@ XPCOMUtils.defineLazyPreferenceGetter(
Expand All @@ -16,26 +16,17 @@ index c504c9afc43785b5f003bb1f9f1dfbddef38d78b..986c629b88b635a71bd795bd115b9a72
const DEFAULT_FORM_HISTORY_NAME = "searchbar-history";
const SEARCH_BUTTON_CLASS = "urlbar-search-button";

@@ -2154,6 +2161,18 @@ export class UrlbarInput {
@@ -2154,6 +2161,9 @@ 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 +3920,11 @@ export class UrlbarInput {
@@ -3901,6 +3911,11 @@ export class UrlbarInput {
}

_on_click(event) {
Expand All @@ -47,7 +38,7 @@ index c504c9afc43785b5f003bb1f9f1dfbddef38d78b..986c629b88b635a71bd795bd115b9a72
if (
event.target == this.inputField ||
event.target == this._inputContainer ||
@@ -4012,9 +4036,12 @@ export class UrlbarInput {
@@ -4012,9 +4027,12 @@ export class UrlbarInput {
}

_on_mousedown(event) {
Expand All @@ -61,7 +52,7 @@ index c504c9afc43785b5f003bb1f9f1dfbddef38d78b..986c629b88b635a71bd795bd115b9a72

if (
event.target != this.inputField &&
@@ -4024,8 +4051,8 @@ export class UrlbarInput {
@@ -4024,8 +4042,8 @@ export class UrlbarInput {
break;
}

Expand Down

0 comments on commit dd88086

Please sign in to comment.