gracefully handle grabs failing when doing interactive actions

This commit is contained in:
Dana Jansens 2003-10-11 16:19:17 +00:00
parent 7ca410e663
commit 055aa5cd74
3 changed files with 10 additions and 7 deletions

View file

@ -946,7 +946,8 @@ void action_run_list(GSList *acts, ObClient *c, ObFrameContext context,
a->data.inter.cancel = cancel;
a->data.inter.final = done;
if (!(cancel || done))
keyboard_interactive_grab(state, a->data.any.c, a);
if (!keyboard_interactive_grab(state, a->data.any.c, a))
continue;
/* interactive actions are not queued */
a->func(&a->data);

View file

@ -155,8 +155,8 @@ gboolean keyboard_bind(GList *keylist, ObAction *action)
return TRUE;
}
void keyboard_interactive_grab(guint state, ObClient *client,
ObAction *action)
gboolean keyboard_interactive_grab(guint state, ObClient *client,
ObAction *action)
{
ObInteractiveState *s;
@ -164,10 +164,10 @@ void keyboard_interactive_grab(guint state, ObClient *client,
if (!interactive_states) {
if (!grab_keyboard(TRUE))
return;
return FALSE;
if (!grab_pointer(TRUE, OB_CURSOR_NONE)) {
grab_keyboard(FALSE);
return;
return FALSE;
}
}
@ -178,6 +178,8 @@ void keyboard_interactive_grab(guint state, ObClient *client,
s->actions = g_slist_append(NULL, action);
interactive_states = g_slist_append(interactive_states, s);
return TRUE;
}
void keyboard_interactive_end(ObInteractiveState *s,

View file

@ -39,8 +39,8 @@ void keyboard_unbind_all();
void keyboard_event(struct _ObClient *client, const XEvent *e);
void keyboard_reset_chains();
void keyboard_interactive_grab(guint state, struct _ObClient *client,
struct _ObAction *action);
gboolean keyboard_interactive_grab(guint state, struct _ObClient *client,
struct _ObAction *action);
gboolean keyboard_process_interactive_grab(const XEvent *e,
struct _ObClient **client);