From: Mikael Magnusson Date: Mon, 16 Aug 2010 01:24:15 +0000 (+0200) Subject: Allow specifying several mousebinds in one go (hack) X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=55e52ce1b26d3a5e736bee6095ac4c403cca15e9;p=mikachu%2Fopenbox.git Allow specifying several mousebinds in one go (hack) Doesn't handle trivial stuff like multiple spaces, it's 3:24am so no guarantees otherwise either. --- diff --git a/openbox/config.c b/openbox/config.c index b824822b..f5ac1095 100644 --- a/openbox/config.c +++ b/openbox/config.c @@ -584,8 +584,23 @@ static void parse_mouse(xmlNodePtr node, gpointer d) while (nact) { ObActionsAct *action; - if ((action = actions_parse(nact))) - mouse_bind(buttonstr, cx, mact, action); + if ((action = actions_parse(nact))) { + gchar *p = buttonstr; + while (*p) { + gchar *s = strchr(p, ' '); + if (s) { + *s = '\0'; + } else { + s = p; + while (*++s); + s--; + } + mouse_bind(p, cx, mact, action); + actions_act_ref(action); /* ref the action for each binding */ + p = s+1; + } + actions_act_unref(action); /* remove the extra ref */ + } nact = obt_xml_find_node(nact->next, "action"); } g_free(buttonstr);