summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2013-05-27 19:41:09 +0200
committerportix <portix@gmx.net>2013-05-27 19:41:09 +0200
commit74ee3dfc7cbb42c96a626836832e2eb7adf7dc12 (patch)
tree753b9f8f71f42bba037b45135d48c192fa18dfd6 /src
parenta3c5d7cb962543f9997b2c7ac85313576abc511d (diff)
downloaddwb-74ee3dfc7cbb42c96a626836832e2eb7adf7dc12.zip
Allow entering numbers with hint-style number, lowercase letters with hintstyle letter
Diffstat (limited to 'src')
-rw-r--r--src/dwb.c6
-rw-r--r--src/scripts.c1
2 files changed, 5 insertions, 2 deletions
diff --git a/src/dwb.c b/src/dwb.c
index c923ac03..ae04139d 100644
--- a/src/dwb.c
+++ b/src/dwb.c
@@ -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)
{