-gboolean keyboard_interactive_grab(guint state, ObClient *client,
- ObAction *action)
-{
- ObInteractiveState *s;
-
- g_assert(action->data.any.interactive);
-
- if (!interactive_states) {
- if (!grab_keyboard(TRUE)) {
- ob_debug("grab KEYBOARD failed\n");
- return FALSE;
- }
- }
-
- s = g_new(ObInteractiveState, 1);
-
- s->state = state;
- s->client = client;
- s->actions = g_slist_append(NULL, action);
-
- interactive_states = g_slist_append(interactive_states, s);
-
- return TRUE;
-}
-
-void keyboard_interactive_end(ObInteractiveState *s,
- guint state, gboolean cancel, Time time)
-{
- action_run_interactive(s->actions, s->client, state, time, cancel, TRUE);
-
- g_slist_free(s->actions);
- g_free(s);
-
- interactive_states = g_slist_remove(interactive_states, s);
-
- if (!interactive_states) {
- grab_keyboard(FALSE);
- keyboard_reset_chains();
- }
-}
-
-void keyboard_interactive_end_client(ObClient *client, gpointer data)
-{
- GSList *it, *next;
-
- for (it = interactive_states; it; it = next) {
- ObInteractiveState *s = it->data;
-
- next = g_slist_next(it);
-
- if (s->client == client)
- s->client = NULL;
- }
-}
-