From 186a3438ac18110206588f44f678b2baf3cada01 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Thu, 24 Feb 2011 16:50:55 -0500 Subject: [PATCH] Fix bluring editible windows, I hope. --- common/content/dactyl.js | 8 +++++--- common/content/events.js | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 3dd1fbb6..41901e90 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -527,9 +527,11 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { if (dactyl.focusedElement) dactyl.focusedElement.blur(); if (win && Editor.getEditor(win)) { - win.blur(); - if (win.frameElement && false) - win.frameElement.blur(); + this.withSavedValues(["ignoreFocus"], function _focusContent() { + this.ignoreFocus = true; + if (win.frameElement) + win.frameElement.blur(); + }); } } diff --git a/common/content/events.js b/common/content/events.js index b2e65fe9..41ea97a3 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -1340,6 +1340,8 @@ var Events = Module("events", { // Huh? --djk onFocusChange: function onFocusChange(event) { function hasHTMLDocument(win) win && win.document && win.document instanceof HTMLDocument + if (dactyl.ignoreFocus) + return; let win = window.document.commandDispatcher.focusedWindow; let elem = window.document.commandDispatcher.focusedElement;