-void keyboard_interactive_grab(guint state, ObClient *client,
- ObAction *action)
-{
- ObInteractiveState *s;
-
- g_assert(action->data.any.interactive);
-
- if (moveresize_in_progress)
- moveresize_end(FALSE);
-
- if (!interactive_states) {
- if (!grab_keyboard(TRUE))
- return;
- if (!grab_pointer(TRUE, OB_CURSOR_NONE)) {
- grab_keyboard(FALSE);
- return;
- }
- }
-
- s = g_new(ObInteractiveState, 1);
-
- s->state = state;
- s->client = client;
- s->action = action;
-
- interactive_states = g_slist_append(interactive_states, s);
-}
-
-void keyboard_interactive_end(ObInteractiveState *s,
- guint state, gboolean cancel)
-{
- action_run_interactive(s->action, s->client, state, cancel, TRUE);
-
- g_free(s);
-
- interactive_states = g_slist_remove(interactive_states, s);
-
- if (!interactive_states) {
- grab_keyboard(FALSE);
- grab_pointer(FALSE, OB_CURSOR_NONE);
- keyboard_reset_chains();
- }
-}
-
-void keyboard_interactive_end_client(gpointer data)
-{
- GSList *it, *next;
- ObClient *c = data;
-
- for (it = interactive_states; it; it = next) {
- ObInteractiveState *s = it->data;
-
- next = g_slist_next(it);
-
- if (s->client == c)
- keyboard_interactive_end(s, 0, FALSE);
- }
-}
-