diff --git a/common/content/commandline.js b/common/content/commandline.js index 18865e97..c53ed173 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -1168,9 +1168,9 @@ var CommandLine = Module("commandline", { availableHeight -= extra || 0; doc.body.style.minWidth = this.widgets.commandbar.commandline.scrollWidth + "px"; - this.widgets.mowContainer.height = Math.min(doc.height, availableHeight) + "px"; + this.widgets.mowContainer.height = Math.min(doc.body.clientHeight, availableHeight) + "px"; this.timeout(function () - this.widgets.mowContainer.height = Math.min(doc.height, availableHeight) + "px", + this.widgets.mowContainer.height = Math.min(doc.body.clientHeight, availableHeight) + "px", 0); doc.body.style.minWidth = ""; diff --git a/common/content/events.js b/common/content/events.js index b9c4f5c7..1d4dedaa 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -106,7 +106,8 @@ var Events = Module("events", { */ wrapListener: function wrapListener(method, self) { self = self || this; - return function wrappedListener(event) { + method.wrapped = wrappedListener; + function wrappedListener(event) { try { method.apply(self, arguments); } @@ -118,6 +119,7 @@ var Events = Module("events", { dactyl.echoerr("Processing " + event.type + " event: " + (e.echoerr || e)); } }; + return wrappedListener; }, /** @@ -865,11 +867,13 @@ var Events = Module("events", { this._input = null; if (!input) { let ignore = false; + let overrideMode = null; // menus have their own command handlers if (modes.extended & modes.MENU) - ignore = true; - else if (modes.main == modes.PASS_THROUGH) + overrideMode = modes.MENU; + + if (modes.main == modes.PASS_THROUGH) ignore = !Events.isEscape(key) && key != ""; else if (modes.main == modes.QUOTE) { if (modes.getStack(1).main == modes.PASS_THROUGH) { @@ -896,7 +900,7 @@ var Events = Module("events", { if (key in config.ignoreKeys && (config.ignoreKeys[key] & mode.main)) return null; - input = Events.KeyProcessor(mode.params.mainMode || mode.main, mode.extended); + input = Events.KeyProcessor(overrideMode || mode.params.mainMode || mode.main, mode.extended); if (mode.params.preExecute) input.preExecute = mode.params.preExecute; if (mode.params.postExecute) diff --git a/common/modules/util.jsm b/common/modules/util.jsm index 0fcdc920..919b1221 100644 --- a/common/modules/util.jsm +++ b/common/modules/util.jsm @@ -68,7 +68,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), __noSuchMethod__: function (meth, args) { let win = util.activeWindow; var dactyl = global && global.dactyl || win && win.dactyl; - if (!win) + if (!dactyl) return null; let prop = dactyl[meth]; @@ -102,6 +102,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), } catch (e) {} } + Class.replaceProperty(obj, "observe", function (subject, target, data) { try {