add a debug action.. change focus debug output a lil, no grab events
Dana Jansens danakj@orodu.net
3 files changed,
30 insertions(+),
1 deletions(-)
M
openbox/action.c
→
openbox/action.c
@@ -95,6 +95,8 @@
/* 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 @@
/* 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 @@
ActionString actionstrings[] = { { + "debug", + action_debug, + NULL + }, + { "execute", - action_execute, + action_execute, NULL }, {@@ -974,6 +983,9 @@ act->data.execute.name = parse_string(doc, m);
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);@@ -1181,6 +1193,12 @@
l = g_slist_append(NULL, a); 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)
M
openbox/action.h
→
openbox/action.h
@@ -71,6 +71,10 @@ ObDirection direction;
gboolean hang; }; +struct Debug { + gchar *string; +}; + struct Execute { struct AnyAction any; gchar *path;@@ -157,6 +161,7 @@ struct AnyAction any;
struct InteractiveAction inter; struct InterDirectionalAction interdiraction; struct DirectionalAction diraction; + struct Debug debug; struct Execute execute; struct ClientAction client; struct Activate activate;@@ -185,6 +190,7 @@
/* Creates a new Action from the name of the action A few action types need data set after making this call still. Check if the returned action's "func" is one of these. + action_debug - the string to print should be set action_execute - the path needs to be set action_restart - the path can optionally be set action_desktop - the destination desktop needs to be set@@ -234,6 +240,8 @@ action_run_list(a, c, OB_FRAME_CONTEXT_NONE, s, 0, -1, -1, t, FALSE, FALSE)
void action_run_string(const gchar *name, struct _ObClient *c, Time time); +/* Debug */ +void action_debug(union ActionData *data); /* Execute */ void action_execute(union ActionData *data); /* ActivateAction */
M
openbox/event.c
→
openbox/event.c
@@ -394,6 +394,9 @@ case NotifyPointerRoot: detailstr="NotifyPointerRoot"; break;
case NotifyDetailNone: detailstr="NotifyDetailNone"; break; } + if (mode == NotifyGrab || mode == NotifyUngrab) + return; + g_assert(modestr); g_assert(detailstr); ob_debug_type(OB_DEBUG_FOCUS, "Focus%s 0x%x mode=%s detail=%s\n",