mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 16:35:30 +02:00
Fixed glance opening on multiple windows (https://github.com/zen-browser/desktop/issues/2444)
This commit is contained in:
parent
b8d9d79ccc
commit
c8ab57a01e
2 changed files with 5 additions and 9 deletions
|
@ -8,6 +8,8 @@
|
|||
#animating = false;
|
||||
|
||||
init() {
|
||||
document.documentElement.setAttribute("zen-glance-uuid", gZenUIManager.generateUuidv4());
|
||||
|
||||
ChromeUtils.defineLazyGetter(
|
||||
this,
|
||||
'overlay',
|
||||
|
@ -42,14 +44,9 @@
|
|||
|
||||
window.addEventListener("keydown", this.onKeyDown.bind(this));
|
||||
|
||||
Services.obs.addObserver(this, "zen-glance-open");
|
||||
this.initProgressListener();
|
||||
}
|
||||
|
||||
observe(subject, topic, data) {
|
||||
this.openGlance(JSON.parse(data));
|
||||
}
|
||||
|
||||
initProgressListener() {
|
||||
this.progressListener = {
|
||||
QueryInterface: ChromeUtils.generateQI(['nsIWebProgressListener', 'nsISupportsWeakReference']),
|
||||
|
@ -243,7 +240,6 @@
|
|||
|
||||
window.gZenGlanceManager = new ZenGlanceManager();
|
||||
|
||||
|
||||
function registerWindowActors() {
|
||||
if (Services.prefs.getBoolPref("zen.glance.enabled", true)) {
|
||||
gZenActorsManager.addJSWindowActor("ZenGlance", {
|
||||
|
|
|
@ -12,13 +12,13 @@ export class ZenGlanceParent extends JSWindowActorParent {
|
|||
return Services.prefs.getIntPref('zen.glance.hold-duration', 500);
|
||||
}
|
||||
case 'ZenGlance:OpenGlance': {
|
||||
this.openGlance(message.data);
|
||||
this.openGlance(this.browsingContext.topChromeWindow, message.data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
openGlance(data) {
|
||||
Services.obs.notifyObservers(null, 'zen-glance-open', JSON.stringify(data));
|
||||
openGlance(window, data) {
|
||||
window.gZenGlanceManager.openGlance(data);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue