When the execute action was run, we would say that the user had used the focused
at that time. Then when a new window popped up, we'd think the user was busy in
the current window and prevent the new one from steal focus.
Now the execute action does not update the "user interacted with the focused
window" timestamp anymore. So, if they aren't currently typing in some window
when they trigger an execute action, and the window appears, it will steal
focus.
ObActionsDataFreeFunc free;
ObActionsRunFunc run;
ObActionsShutdownFunc shutdown;
ObActionsDataFreeFunc free;
ObActionsRunFunc run;
ObActionsShutdownFunc shutdown;
+ gboolean modifies_focused_window;
};
struct _ObActionsAct {
};
struct _ObActionsAct {
- def = g_slice_new(ObActionsDefinition);
+ def = g_slice_new0(ObActionsDefinition);
def->ref = 1;
def->name = g_strdup(name);
def->free = free;
def->run = run;
def->shutdown = NULL;
def->ref = 1;
def->name = g_strdup(name);
def->free = free;
def->run = run;
def->shutdown = NULL;
+ def->modifies_focused_window = TRUE;
registered = g_slist_prepend(registered, def);
return def;
registered = g_slist_prepend(registered, def);
return def;
+gboolean actions_set_modifies_focused_window(const gchar *name,
+ gboolean modifies)
+{
+ GSList *it;
+ ObActionsDefinition *def;
+
+ for (it = registered; it; it = g_slist_next(it)) {
+ def = it->data;
+ if (!g_ascii_strcasecmp(name, def->name)) {
+ def->modifies_focused_window = modifies;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
static void actions_definition_ref(ObActionsDefinition *def)
{
++def->ref;
static void actions_definition_ref(ObActionsDefinition *def)
{
++def->ref;
if (!act->def->run(&data, act->options)) {
if (actions_act_is_interactive(act))
actions_interactive_end_act();
if (!act->def->run(&data, act->options)) {
if (actions_act_is_interactive(act))
actions_interactive_end_act();
- if (client && client == focus_client)
+ if (client && client == focus_client &&
+ act->def->modifies_focused_window)
+ {
} else {
/* make sure its interactive if it returned TRUE */
g_assert(act->i_input);
} else {
/* make sure its interactive if it returned TRUE */
g_assert(act->i_input);
gboolean actions_set_shutdown(const gchar *name,
ObActionsShutdownFunc shutdown);
gboolean actions_set_shutdown(const gchar *name,
ObActionsShutdownFunc shutdown);
+gboolean actions_set_modifies_focused_window(const gchar *name,
+ gboolean modifies);
ObActionsAct* actions_parse(xmlNodePtr node);
ObActionsAct* actions_parse_string(const gchar *name);
ObActionsAct* actions_parse(xmlNodePtr node);
ObActionsAct* actions_parse_string(const gchar *name);
{
actions_register("Execute", setup_func, free_func, run_func);
actions_set_shutdown("Execute", shutdown_func);
{
actions_register("Execute", setup_func, free_func, run_func);
actions_set_shutdown("Execute", shutdown_func);
+ actions_set_modifies_focused_window("Execute", FALSE);
client_add_destroy_notify(client_dest, NULL);
}
client_add_destroy_notify(client_dest, NULL);
}
/*! The amount of time before a window appears that is checked for user input
to determine if the user is working in another window */
/*! The amount of time before a window appears that is checked for user input
to determine if the user is working in another window */
-#define OB_EVENT_USER_TIME_DELAY (1000) /* 1.0 seconds */
+#define OB_EVENT_USER_TIME_DELAY (1000) /* milliseconds */
/*! The last user-interaction time, as given by the clients */
extern Time event_last_user_time;
/*! The last user-interaction time, as given by the clients */
extern Time event_last_user_time;