1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-09 09:34:12 +01:00

Go to irritating lengths to keep the hidden location bar from stealing keyboard focus. Closes issue #292.

This commit is contained in:
Kris Maglione
2011-01-22 10:12:44 -05:00
parent f33ae2b044
commit c10e05bbe4
2 changed files with 11 additions and 3 deletions

View File

@@ -143,9 +143,10 @@ var Events = Module("events", {
catch (e) {
dactyl.reportError(e);
if (e.message == "Interrupted")
dactyl.echoerr("Interrupted");
dactyl.echoerr("Interrupted", commandline.FORCE_SINGLELINE);
else
dactyl.echoerr("Processing " + event.type + " event: " + (e.echoerr || e));
dactyl.echoerr("Processing " + event.type + " event: " + (e.echoerr || e),
commandline.FORCE_SINGLELINE);
}
};
return wrappedListener;
@@ -739,6 +740,13 @@ var Events = Module("events", {
if (elem instanceof Element) {
let win = elem.ownerDocument.defaultView;
if (event.target instanceof Ci.nsIDOMXULTextBoxElement)
for (let e = elem; e; e = e.parentNode)
if (util.computedStyle(e).visibility !== "visible") {
elem.blur();
break;
}
if (events.isContentNode(elem) && !buffer.focusAllowed(elem)
&& !(services.focus.getLastFocusMethod(win) & 0x7000)
&& isinstance(elem, [HTMLInputElement, HTMLSelectElement, HTMLTextAreaElement, Window])) {