about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMarco Peereboom <marco@conformal.com>2011-11-09 12:51:37 -0600
committerMarco Peereboom <marco@conformal.com>2011-11-09 12:51:37 -0600
commitf9b12bd17c7f263670e16d8ebd60c06dee8dba73 (patch)
tree60cb085f15153fbf6a6928af0244e99b19125dbf
parent39bd3d4bdec348a345ae210157b1978cdd128ca3 (diff)
downloadxombrero-f9b12bd17c7f263670e16d8ebd60c06dee8dba73.tar.gz
fix some sites that screw with keyboard focus
This changes the behavior buffercommands by returning USED vs
PASSTHROUGH on non ascii characters.  This seems to work but I don't
know if this affects non-US keyboards in any way.  Please test this a
lot!
-rw-r--r--xxxterm.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/xxxterm.c b/xxxterm.c
index 453f6cb..7659877 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -2548,8 +2548,8 @@ focus_input(struct tab *t)
 	WebKitDOMNodeList	*fl = NULL, *ifl = NULL;
 	int			i, fl_count, ifl_count, rv = 0;
 
-	WebKitDOMHTMLFrameElement *frame;
-	WebKitDOMHTMLIFrameElement *iframe;
+	WebKitDOMHTMLFrameElement	*frame;
+	WebKitDOMHTMLIFrameElement	*iframe;
 
 	/*
 	 * Here is what we are doing:
@@ -4885,8 +4885,16 @@ buffercmd_addkey(struct tab *t, guint keyval)
 	}
 
 	/* key with modifier or non-ascii character */
-	if (!isascii(keyval))
-		return (XT_CB_PASSTHROUGH);
+	if (!isascii(keyval)) {
+		/*
+		 * XXX this looks wrong but fixes some sites like
+		 * http://www.seslisozluk.com/
+		 * that eat a shift or ctrl and end putting default focus in js
+		 * instead of ignoring the keystroke
+		 * so instead of return (XT_CB_PASSTHROUGH); eat the key
+		 */
+		return (XT_CB_HANDLED);
+	}
 
 	DNPRINTF(XT_D_BUFFERCMD, "buffercmd_addkey: adding key \"%c\" "
 	    "to buffer \"%s\"\n", keyval, bcmd);