summaryrefslogtreecommitdiff
path: root/openbox/action.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-05-14 03:40:03 +0000
committerDana Jansens <danakj@orodu.net>2007-05-14 03:40:03 +0000
commita019ee1028c396f7d5ec107d100b43222c945b59 (patch)
tree01371bff8d54ae70b71983357a03c1c374c13d86 /openbox/action.c
parentd0a579eda06d11371ff6525ae9d96c1de72b75b0 (diff)
add a debug action.. change focus debug output a lil, no grab events
Diffstat (limited to 'openbox/action.c')
-rw-r--r--openbox/action.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/openbox/action.c b/openbox/action.c
index 20bf686f..aa9465b8 100644
--- a/openbox/action.c
+++ b/openbox/action.c
@@ -95,6 +95,8 @@ void action_unref(ObAction *a)
/* deal with pointers */
if (a->func == action_execute || a->func == action_restart)
g_free(a->data.execute.path);
+ else if (a->func == action_debug)
+ g_free(a->data.debug.string);
else if (a->func == action_showmenu)
g_free(a->data.showmenu.name);
@@ -110,6 +112,8 @@ ObAction* action_copy(const ObAction *src)
/* deal with pointers */
if (a->func == action_execute || a->func == action_restart)
a->data.execute.path = g_strdup(a->data.execute.path);
+ else if (a->func == action_debug)
+ a->data.debug.string = g_strdup(a->data.debug.string);
else if (a->func == action_showmenu)
a->data.showmenu.name = g_strdup(a->data.showmenu.name);
@@ -472,8 +476,13 @@ void setup_client_action(ObAction **a, ObUserAction uact)
ActionString actionstrings[] =
{
{
+ "debug",
+ action_debug,
+ NULL
+ },
+ {
"execute",
- action_execute,
+ action_execute,
NULL
},
{
@@ -974,6 +983,9 @@ ObAction *action_parse(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
if ((m = parse_find_node("icon", n->xmlChildrenNode)))
act->data.execute.icon_name = parse_string(doc, m);
}
+ } else if (act->func == action_debug) {
+ if ((n = parse_find_node("string", node->xmlChildrenNode)))
+ act->data.debug.string = parse_string(doc, n);
} else if (act->func == action_showmenu) {
if ((n = parse_find_node("menu", node->xmlChildrenNode)))
act->data.showmenu.name = parse_string(doc, n);
@@ -1183,6 +1195,12 @@ void action_run_string(const gchar *name, struct _ObClient *c, Time time)
action_run(l, c, 0, time);
}
+void action_debug(union ActionData *data)
+{
+ if (data->debug.string)
+ g_print("%s\n", data->debug.string);
+}
+
void action_execute(union ActionData *data)
{
GError *e = NULL;