X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Factions.c;h=2c60ba4096313ac8a7ec2388226c820f87a95b33;hb=5b6f3c6f7a0e4f1efe3c90865226f02ffa03ca9e;hp=023fab3ab5c96291ce0508c4527bc035cdfd0c07;hpb=6014a41760a107d817422aa5412ccf0ce3fc6e92;p=chaz%2Fopenbox diff --git a/openbox/actions.c b/openbox/actions.c index 023fab3a..2c60ba40 100644 --- a/openbox/actions.c +++ b/openbox/actions.c @@ -49,6 +49,7 @@ struct _ObActionsDefinition { } setup; ObActionsDataFreeFunc free; ObActionsRunFunc run; + ObActionsShutdownFunc shutdown; }; struct _ObActionsAct { @@ -79,7 +80,9 @@ void actions_shutdown(gboolean reconfig) /* free all the registered actions */ while (registered) { - actions_definition_unref(registered->data); + ObActionsDefinition *d = registered->data; + if (d->shutdown) d->shutdown(); + actions_definition_unref(d); registered = g_slist_delete_link(registered, registered); } } @@ -135,6 +138,22 @@ gboolean actions_register(const gchar *name, return def != NULL; } +gboolean actions_set_shutdown(const gchar *name, + ObActionsShutdownFunc shutdown) +{ + GSList *it; + ObActionsDefinition *def; + + for (it = registered; it; it = g_slist_next(it)) { + def = it->data; + if (!g_ascii_strcasecmp(name, def->name)) { + def->shutdown = shutdown; + return TRUE; + } + } + return FALSE; +} + static void actions_definition_ref(ObActionsDefinition *def) { ++def->ref; @@ -378,6 +397,7 @@ gboolean actions_interactive_input_event(XEvent *e) gboolean used = FALSE; if (interactive_act) { if (!interactive_act->i_input(interactive_initial_state, e, + grab_input_context(), interactive_act->options, &used)) { used = TRUE; /* if it cancelled the action then it has to of