diff options
author | portix <portix@gmx.net> | 2013-05-27 19:41:09 +0200 |
---|---|---|
committer | portix <portix@gmx.net> | 2013-05-27 19:41:09 +0200 |
commit | 74ee3dfc7cbb42c96a626836832e2eb7adf7dc12 (patch) | |
tree | 753b9f8f71f42bba037b45135d48c192fa18dfd6 /src | |
parent | a3c5d7cb962543f9997b2c7ac85313576abc511d (diff) | |
download | dwb-74ee3dfc7cbb42c96a626836832e2eb7adf7dc12.zip |
Allow entering numbers with hint-style number, lowercase letters with hintstyle letter
Diffstat (limited to 'src')
-rw-r--r-- | src/dwb.c | 6 | ||||
-rw-r--r-- | src/scripts.c | 1 |
2 files changed, 5 insertions, 2 deletions
@@ -2161,6 +2161,8 @@ dwb_update_hints(GdkEventKey *e) char *val; gboolean ret = false; char json[BUFFER_LENGTH] = {0}; + const char *text; + char *escaped; if (IS_RETURN_KEY(e)) { @@ -2183,9 +2185,11 @@ dwb_update_hints(GdkEventKey *e) else { val = util_keyval_to_char(e->keyval, true); - snprintf(json, sizeof(json), "{ \"input\" : \"%s%s\", \"type\" : %d }", GET_TEXT(), val ? val : "", hint_map[dwb.state.hint_type].arg); + escaped = g_strescape(GET_TEXT(), NULL); + snprintf(json, sizeof(json), "{ \"input\" : \"%s%s\", \"type\" : %d }", escaped, val ? (*val == '\\' ? "\\\\" : val) : "", hint_map[dwb.state.hint_type].arg); com = "updateHints"; g_free(val); + g_free(escaped); } if (com) { diff --git a/src/scripts.c b/src/scripts.c index 3bc33488..efbd75cf 100644 --- a/src/scripts.c +++ b/src/scripts.c @@ -5702,7 +5702,6 @@ scripts_reapply() gboolean scripts_init(gboolean force) { - puts(SCRIPT_TEMPLATE_XINCLUDE); dwb.misc.script_signals = 0; if (s_global_context == NULL) { |