openbox/actions/shade.c \
openbox/actions/showdesktop.c \
openbox/actions/showmenu.c \
+ openbox/actions/stop.c \
openbox/actions/unfocus.c \
openbox/actions.c \
openbox/actions.h \
data->client = client;
}
-void actions_run_acts(GSList *acts,
- ObUserAction uact,
- guint state,
- gint x,
- gint y,
- gint button,
- ObFrameContext con,
- struct _ObClient *client)
+gboolean actions_run_acts(GSList *acts,
+ ObUserAction uact,
+ guint state,
+ gint x,
+ gint y,
+ gint button,
+ ObFrameContext con,
+ struct _ObClient *client)
{
GSList *it;
if (actions_act_is_interactive(act))
actions_interactive_end_act();
} else {
- /* make sure its interactive if it returned TRUE */
- g_assert(act->def->i_cancel && act->def->i_input);
-
- /* no actions are run after the interactive one */
- break;
+ /* stop running actions if some return TRUE
+ This happens either from interactive actions or
+ the Stop action. */
+ return TRUE;
}
}
}
+
+ return FALSE;
}
gboolean actions_interactive_act_running(void)
gboolean actions_get_need_pointer_replay_before_move(void);
/*! Pass in a GSList of ObActionsAct's to be run. */
-void actions_run_acts(GSList *acts,
- ObUserAction uact,
- guint state,
- gint x,
- gint y,
- gint button,
- ObFrameContext con,
- struct _ObClient *client);
+gboolean actions_run_acts(GSList *acts,
+ ObUserAction uact,
+ guint state,
+ gint x,
+ gint y,
+ gint button,
+ ObFrameContext con,
+ struct _ObClient *client);
gboolean actions_interactive_act_running(void);
void actions_interactive_cancel_act(void);
action_sendkeyevent_startup();
action_lock_startup();
action_allclients_startup();
+ action_stop_startup();
}
void action_sendkeyevent_startup(void);
void action_lock_startup(void);
void action_zenbu_startup(void);
+void action_stop_startup(void);
#endif
if (a)
for (it = client_list; it; it = g_list_next(it)) {
ObClient *c = it->data;
- actions_run_acts(a, data->uact, data->state,
- data->x, data->y, data->button,
- data->context, c);
+ if (actions_run_acts(a, data->uact, data->state,
+ data->x, data->y, data->button,
+ data->context, c))
+ return TRUE;
}
return FALSE;
else
acts = o->elseacts;
- actions_run_acts(acts, data->uact, data->state,
- data->x, data->y, data->button,
- data->context, data->client);
-
- return FALSE;
+ return actions_run_acts(acts, data->uact, data->state,
+ data->x, data->y, data->button,
+ data->context, data->client);
}
--- /dev/null
+#include "openbox/actions.h"
+
+static gboolean run_func(ObActionsData *data, gpointer options);
+
+void action_stop_startup(void)
+{
+ actions_register("Stop", NULL, NULL, run_func, NULL, NULL);
+}
+
+/* return TRUE to stop other actions from running */
+static gboolean run_func(ObActionsData *data, gpointer options)
+{
+ return TRUE;
+}