+void action_run_list(GSList *acts, ObClient *c, ObFrameContext context,
+ guint state, guint button, gint x, gint y,
+ gboolean cancel, gboolean done)
+{
+ GSList *it;
+ ObAction *a;
+ gboolean inter = FALSE;
+
+ if (!acts)
+ return;
+
+ if (x < 0 && y < 0)
+ screen_pointer_pos(&x, &y);
+
+ if (grab_on_keyboard())
+ inter = TRUE;
+ else
+ for (it = acts; it; it = g_slist_next(it)) {
+ a = it->data;
+ if (a->data.any.interactive) {
+ inter = TRUE;
+ break;
+ }
+ }
+
+ if (!inter) {
+ /* sometimes when we execute another app as an action,
+ it won't work right unless we XUngrabKeyboard first,
+ even though we grabbed the key/button Asychronously.
+ e.g. "gnome-panel-control --main-menu" */
+ XUngrabKeyboard(ob_display, event_lasttime);
+ }
+
+ for (it = acts; it; it = g_slist_next(it)) {
+ a = it->data;
+
+ if (!(a->data.any.client_action == OB_CLIENT_ACTION_ALWAYS && !c)) {
+ a->data.any.c = a->data.any.client_action ? c : NULL;
+ a->data.any.context = context;
+ a->data.any.x = x;
+ a->data.any.y = y;
+
+ a->data.any.button = button;
+
+ if (a->data.any.interactive) {
+ a->data.inter.cancel = cancel;
+ a->data.inter.final = done;
+ if (!(cancel || done))
+ if (!keyboard_interactive_grab(state, a->data.any.c, a))
+ continue;
+ }
+
+ /* XXX UGLY HACK race with motion event starting a move and the
+ button release gettnig processed first. answer: don't queue
+ moveresize starts. UGLY HACK XXX */
+ if (a->data.any.interactive || a->func == action_moveresize) {
+ /* interactive actions are not queued */
+ a->func(&a->data);
+ } else
+ ob_main_loop_queue_action(ob_main_loop, a);
+ }
+ }
+}
+
+void action_run_string(const gchar *name, struct _ObClient *c)
+{
+ ObAction *a;
+ GSList *l;
+
+ a = action_from_string(name, OB_USER_ACTION_NONE);
+ g_assert(a);
+
+ l = g_slist_append(NULL, a);
+
+ action_run(l, c, 0);
+}
+