gracefully handle grabs failing when doing interactive actions
This commit is contained in:
parent
7ca410e663
commit
055aa5cd74
3 changed files with 10 additions and 7 deletions
|
@ -946,7 +946,8 @@ void action_run_list(GSList *acts, ObClient *c, ObFrameContext context,
|
||||||
a->data.inter.cancel = cancel;
|
a->data.inter.cancel = cancel;
|
||||||
a->data.inter.final = done;
|
a->data.inter.final = done;
|
||||||
if (!(cancel || 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 */
|
/* interactive actions are not queued */
|
||||||
a->func(&a->data);
|
a->func(&a->data);
|
||||||
|
|
|
@ -155,8 +155,8 @@ gboolean keyboard_bind(GList *keylist, ObAction *action)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void keyboard_interactive_grab(guint state, ObClient *client,
|
gboolean keyboard_interactive_grab(guint state, ObClient *client,
|
||||||
ObAction *action)
|
ObAction *action)
|
||||||
{
|
{
|
||||||
ObInteractiveState *s;
|
ObInteractiveState *s;
|
||||||
|
|
||||||
|
@ -164,10 +164,10 @@ void keyboard_interactive_grab(guint state, ObClient *client,
|
||||||
|
|
||||||
if (!interactive_states) {
|
if (!interactive_states) {
|
||||||
if (!grab_keyboard(TRUE))
|
if (!grab_keyboard(TRUE))
|
||||||
return;
|
return FALSE;
|
||||||
if (!grab_pointer(TRUE, OB_CURSOR_NONE)) {
|
if (!grab_pointer(TRUE, OB_CURSOR_NONE)) {
|
||||||
grab_keyboard(FALSE);
|
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);
|
s->actions = g_slist_append(NULL, action);
|
||||||
|
|
||||||
interactive_states = g_slist_append(interactive_states, s);
|
interactive_states = g_slist_append(interactive_states, s);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void keyboard_interactive_end(ObInteractiveState *s,
|
void keyboard_interactive_end(ObInteractiveState *s,
|
||||||
|
|
|
@ -39,8 +39,8 @@ void keyboard_unbind_all();
|
||||||
void keyboard_event(struct _ObClient *client, const XEvent *e);
|
void keyboard_event(struct _ObClient *client, const XEvent *e);
|
||||||
void keyboard_reset_chains();
|
void keyboard_reset_chains();
|
||||||
|
|
||||||
void keyboard_interactive_grab(guint state, struct _ObClient *client,
|
gboolean keyboard_interactive_grab(guint state, struct _ObClient *client,
|
||||||
struct _ObAction *action);
|
struct _ObAction *action);
|
||||||
gboolean keyboard_process_interactive_grab(const XEvent *e,
|
gboolean keyboard_process_interactive_grab(const XEvent *e,
|
||||||
struct _ObClient **client);
|
struct _ObClient **client);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue