summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2010-05-17 21:58:44 -0400
committerDana Jansens <danakj@orodu.net>2010-05-17 21:58:44 -0400
commit53430914f0ac7e4e06a484d1fa3b0cf6a79df60b (patch)
tree2f15f92548b5e17bc2865ed84120f65e56d6f5de /openbox
parent9a826d8c3d61150ddd72c621aab870d4bfe4594f (diff)
set the interactive action to NULL before doing its cleanup phase
if the cleanup ends up cancelling the "current interactive action", it would cause the end function to be called again, which sucks. for instance if the cleanup function uses the Focus action. this prevents the unwanted loop into the interactive action cleanup.
Diffstat (limited to 'openbox')
-rw-r--r--openbox/actions.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/openbox/actions.c b/openbox/actions.c
index 463962a2..125084e8 100644
--- a/openbox/actions.c
+++ b/openbox/actions.c
@@ -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);
}
}