]> Dogcows Code - chaz/openbox/blobdiff - openbox/actions.c
make control keys work in menus/dialogs/etc with the new obt code, using XLookup...
[chaz/openbox] / openbox / actions.c
index 023fab3ab5c96291ce0508c4527bc035cdfd0c07..945233e63fae1f71ba5f826e539012dd298354cd 100644 (file)
@@ -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);
     }
 }
@@ -104,6 +107,7 @@ ObActionsDefinition* do_register(const gchar *name,
     def->name = g_strdup(name);
     def->free = free;
     def->run = run;
+    def->shutdown = NULL;
 
     registered = g_slist_prepend(registered, def);
     return def;
@@ -135,6 +139,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 +398,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
This page took 0.0207580000000001 seconds and 4 git commands to generate.