1
Commit : https://github.com/danakj/openbox/commit/683749d3f38891c4073a9918381d8f18a9939dc2
3
Allow windows created by execute actions to steal focus if the user isn't interacting with another window (Fix bug 5419).
5
When the execute action was run, we would say that the user had used the focused
6
at that time. Then when a new window popped up, we'd think the user was busy in
7
the current window and prevent the new one from steal focus.
9
Now the execute action does not update the "user interacted with the focused
10
window" timestamp anymore. So, if they aren't currently typing in some window
11
when they trigger an execute action, and the window appears, it will steal
14
Index: openbox-3.5.0/openbox/actions.c
15
===================================================================
16
--- openbox-3.5.0.orig/openbox/actions.c 2011-08-01 22:14:58.000000000 +0200
17
+++ openbox-3.5.0/openbox/actions.c 2013-06-10 23:56:55.000000000 +0200
19
ObActionsDataFreeFunc free;
21
ObActionsShutdownFunc shutdown;
22
+ gboolean modifies_focused_window;
25
struct _ObActionsAct {
30
- def = g_slice_new(ObActionsDefinition);
31
+ def = g_slice_new0(ObActionsDefinition);
33
def->name = g_strdup(name);
37
+ def->modifies_focused_window = TRUE;
39
registered = g_slist_prepend(registered, def);
45
+gboolean actions_set_modifies_focused_window(const gchar *name,
49
+ ObActionsDefinition *def;
51
+ for (it = registered; it; it = g_slist_next(it)) {
53
+ if (!g_ascii_strcasecmp(name, def->name)) {
54
+ def->modifies_focused_window = modifies;
61
static void actions_definition_ref(ObActionsDefinition *def)
65
if (!act->def->run(&data, act->options)) {
66
if (actions_act_is_interactive(act))
67
actions_interactive_end_act();
68
- if (client && client == focus_client)
69
+ if (client && client == focus_client &&
70
+ act->def->modifies_focused_window)
72
update_user_time = TRUE;
75
/* make sure its interactive if it returned TRUE */
76
g_assert(act->i_input);
77
Index: openbox-3.5.0/openbox/actions.h
78
===================================================================
79
--- openbox-3.5.0.orig/openbox/actions.h 2011-08-01 22:14:58.000000000 +0200
80
+++ openbox-3.5.0/openbox/actions.h 2013-06-10 23:58:24.000000000 +0200
82
gboolean actions_set_shutdown(const gchar *name,
83
ObActionsShutdownFunc shutdown);
85
+gboolean actions_set_modifies_focused_window(const gchar *name,
88
ObActionsAct* actions_parse(xmlNodePtr node);
89
ObActionsAct* actions_parse_string(const gchar *name);
91
Index: openbox-3.5.0/openbox/actions/execute.c
92
===================================================================
93
--- openbox-3.5.0.orig/openbox/actions/execute.c 2011-08-01 22:14:58.000000000 +0200
94
+++ openbox-3.5.0/openbox/actions/execute.c 2013-06-10 23:59:22.000000000 +0200
97
actions_register("Execute", setup_func, free_func, run_func);
98
actions_set_shutdown("Execute", shutdown_func);
99
+ actions_set_modifies_focused_window("Execute", FALSE);
101
client_add_destroy_notify(client_dest, NULL);
103
Index: openbox-3.5.0/openbox/event.h
104
===================================================================
105
--- openbox-3.5.0.orig/openbox/event.h 2011-08-01 22:14:58.000000000 +0200
106
+++ openbox-3.5.0/openbox/event.h 2013-06-10 23:59:57.000000000 +0200
109
/*! The amount of time before a window appears that is checked for user input
110
to determine if the user is working in another window */
111
-#define OB_EVENT_USER_TIME_DELAY (1000) /* 1.0 seconds */
112
+#define OB_EVENT_USER_TIME_DELAY (1000) /* milliseconds */
114
/*! The last user-interaction time, as given by the clients */
115
extern Time event_last_user_time;