mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-23 20:05:53 +01:00
Go to irritating lengths to keep the hidden location bar from stealing keyboard focus. Closes issue #292.
This commit is contained in:
@@ -1245,7 +1245,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
if (error.result == Cr.NS_BINDING_ABORTED)
|
if (error.result == Cr.NS_BINDING_ABORTED)
|
||||||
return;
|
return;
|
||||||
if (echo)
|
if (echo)
|
||||||
dactyl.echoerr(error);
|
dactyl.echoerr(error, commandline.FORCE_SINGLELINE);
|
||||||
util.reportError(error);
|
util.reportError(error);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -143,9 +143,10 @@ var Events = Module("events", {
|
|||||||
catch (e) {
|
catch (e) {
|
||||||
dactyl.reportError(e);
|
dactyl.reportError(e);
|
||||||
if (e.message == "Interrupted")
|
if (e.message == "Interrupted")
|
||||||
dactyl.echoerr("Interrupted");
|
dactyl.echoerr("Interrupted", commandline.FORCE_SINGLELINE);
|
||||||
else
|
else
|
||||||
dactyl.echoerr("Processing " + event.type + " event: " + (e.echoerr || e));
|
dactyl.echoerr("Processing " + event.type + " event: " + (e.echoerr || e),
|
||||||
|
commandline.FORCE_SINGLELINE);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return wrappedListener;
|
return wrappedListener;
|
||||||
@@ -739,6 +740,13 @@ var Events = Module("events", {
|
|||||||
if (elem instanceof Element) {
|
if (elem instanceof Element) {
|
||||||
let win = elem.ownerDocument.defaultView;
|
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)
|
if (events.isContentNode(elem) && !buffer.focusAllowed(elem)
|
||||||
&& !(services.focus.getLastFocusMethod(win) & 0x7000)
|
&& !(services.focus.getLastFocusMethod(win) & 0x7000)
|
||||||
&& isinstance(elem, [HTMLInputElement, HTMLSelectElement, HTMLTextAreaElement, Window])) {
|
&& isinstance(elem, [HTMLInputElement, HTMLSelectElement, HTMLTextAreaElement, Window])) {
|
||||||
|
|||||||
Reference in New Issue
Block a user