grab_for_window(screen_support_win, grab);
for (it = client_list; it; it = g_list_next(it))
- grab_for_window(((ObClient*)it->data)->frame->window, grab);
+ grab_for_window(((ObClient*)it->data)->window, grab);
}
static gboolean chain_timeout(gpointer data)
{
ObInteractiveState *s;
+ g_assert(action->data.any.interactive);
+
if (!interactive_states) {
if (!grab_keyboard(TRUE))
return;
cancel = done = TRUE;
}
if (done) {
- g_assert(s->action->data.any.interactive);
-
- s->action->data.inter.cancel = cancel;
- s->action->data.inter.final = TRUE;
-
- s->action->func(&s->action->data);
-
- grab_keyboard(FALSE);
- grab_pointer(FALSE, OB_CURSOR_NONE);
- keyboard_reset_chains();
+ action_run_interactive(s->action, s->client,
+ e->xkey.state, cancel, TRUE);
g_free(s);
+
interactive_states = g_slist_delete_link(interactive_states, it);
+ if (!interactive_states) {
+ grab_keyboard(FALSE);
+ grab_pointer(FALSE, OB_CURSOR_NONE);
+ keyboard_reset_chains();
+ }
+
handled = TRUE;
}
}
p = curpos->first_child;
while (p) {
if (p->key == e->xkey.keycode &&
- p->state == e->xkey.state) {
+ p->state == e->xkey.state)
+ {
if (p->first_child != NULL) { /* part of a chain */
ob_main_loop_timeout_remove(ob_main_loop, chain_timeout);
/* 5 second timeout for chains */
grab_keys(TRUE);
} else {
GSList *it;
- for (it = p->actions; it; it = it->next) {
- ObAction *act = it->data;
- if (act->func != NULL) {
- act->data.any.c = client;
-
- if (act->func == action_moveresize) {
- screen_pointer_pos(&act->data.moveresize.x,
- &act->data.moveresize.y);
- }
-
- if (act->data.any.interactive) {
- act->data.inter.cancel = FALSE;
- act->data.inter.final = FALSE;
- keyboard_interactive_grab(e->xkey.state, client,
- 0, act);
- }
-
- if (act->func == action_showmenu) {
- act->data.showmenu.x = e->xkey.x_root;
- act->data.showmenu.y = e->xkey.y_root;
- }
-
- act->data.any.c = client;
- act->func(&act->data);
- }
- }
+
+ for (it = p->actions; it; it = it->next)
+ action_run_key(it->data, client, e->xkey.state,
+ e->xkey.x_root, e->xkey.y_root);
keyboard_reset_chains();
}