X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Factions.c;h=125084e8c5ee7c9e776ba60f0a9d40301b5556b7;hb=3ff416203439afb00b66b04f473669eab1f425e4;hp=2324bc95ad846963521458fa8a610e44a7f17308;hpb=4f93731cdbecbf43b82aa000c07ec8b40f97dd03;p=chaz%2Fopenbox diff --git a/openbox/actions.c b/openbox/actions.c index 2324bc95..125084e8 100644 --- a/openbox/actions.c +++ b/openbox/actions.c @@ -368,7 +368,7 @@ static gboolean actions_interactive_begin_act(ObActionsAct *act, guint state) interactive_act = act; actions_act_ref(interactive_act); - interactive_initial_state = state; + interactive_initial_state = obt_keyboard_only_modmasks(state); /* if using focus_delay, stop the timer now so that focus doesn't go moving on us, which would kill the action */ @@ -383,13 +383,19 @@ static gboolean actions_interactive_begin_act(ObActionsAct *act, guint state) static void actions_interactive_end_act(void) { if (interactive_act) { + ObActionsAct *ia = interactive_act; + + /* set this to NULL first so the i_post() function can't cause this to + get called again (if it decides it wants to cancel any ongoing + interactive action). */ + interactive_act = NULL; + ungrab_keyboard(); - if (interactive_act->i_post) - interactive_act->i_post(interactive_act->options); + if (ia->i_post) + ia->i_post(ia->options); - actions_act_unref(interactive_act); - interactive_act = NULL; + actions_act_unref(ia); } }