~ubuntu-branches/debian/sid/openbox/sid

« back to all changes in this revision

Viewing changes to debian/patches/91_fix_loose_focus.patch

  • Committer: Package Import Robot
  • Author(s): Mateusz Łukasik
  • Date: 2013-07-23 08:37:08 UTC
  • Revision ID: package-import@ubuntu.com-20130723083708-mcye16x2l1xlr0v5
Tags: 3.5.0-8
* New maintainer. (Closes: #566900)
* Bump standard version and compat.
* Add python-xdg to dependences:
  + Fix XDG_DATA_DIRS not set when using openbox-gnome-session,
    (Closes: #647427)
  + Fix openbox: missing dependency: python-xdg. (Closes: #695432)
* Update config files:
  + Add debian/patches/704724_fix_refers-to-autostart.sh.patch to fix
    openbox-session(1) refers to autostart.sh files, (Closes: #704724)
  + Add debian/patches/644628_fix_autostart.patch to fix openbox: Please
    provide a way to disable openbox-xdg-autostart via config file.
    (Closes: #644628)
* Remove support for gdm-control and gnome-panel-control to fix
  openbox: gdm-control fails to execute. (Closes: #705793)
* Add 91_fix_loose_focus.patch: From upstream, focus the windows when the
   execute action is run. (Closes: #709439)
* Add patches from Arch Linux:
  + openbox-3.5.0-which-2.20.patch,
  + openbox-3.5.0-title-matching.patch.
* Add 658081_fix_kde_menu.patch:
  + fix bad KDE menu placement when running a KDE/Openbox
  session (Closes: #658081)
* Add add_automake1.11_support.patch: From upstream, add support
  automake 1.11 and newest.
* Switch to Vcs-Git.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Commit : https://github.com/danakj/openbox/commit/683749d3f38891c4073a9918381d8f18a9939dc2
 
2
 
 
3
Allow windows created by execute actions to steal focus if the user isn't interacting with another window (Fix bug 5419).
 
4
 
 
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.
 
8
 
 
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
 
12
focus.
 
13
---
 
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
 
18
@@ -51,6 +51,7 @@
 
19
     ObActionsDataFreeFunc free;
 
20
     ObActionsRunFunc run;
 
21
     ObActionsShutdownFunc shutdown;
 
22
+    gboolean modifies_focused_window;
 
23
 };
 
24
 
 
25
 struct _ObActionsAct {
 
26
@@ -103,12 +104,13 @@
 
27
             return NULL;
 
28
     }
 
29
 
 
30
-    def = g_slice_new(ObActionsDefinition);
 
31
+    def = g_slice_new0(ObActionsDefinition);
 
32
     def->ref = 1;
 
33
     def->name = g_strdup(name);
 
34
     def->free = free;
 
35
     def->run = run;
 
36
     def->shutdown = NULL;
 
37
+    def->modifies_focused_window = TRUE;
 
38
 
 
39
     registered = g_slist_prepend(registered, def);
 
40
     return def;
 
41
@@ -156,6 +158,22 @@
 
42
     return FALSE;
 
43
 }
 
44
 
 
45
+gboolean actions_set_modifies_focused_window(const gchar *name,
 
46
+                                             gboolean modifies)
 
47
+{
 
48
+    GSList *it;
 
49
+    ObActionsDefinition *def;
 
50
+
 
51
+    for (it = registered; it; it = g_slist_next(it)) {
 
52
+        def = it->data;
 
53
+        if (!g_ascii_strcasecmp(name, def->name)) {
 
54
+            def->modifies_focused_window = modifies;
 
55
+            return TRUE;
 
56
+        }
 
57
+    }
 
58
+    return FALSE;
 
59
+}
 
60
+
 
61
 static void actions_definition_ref(ObActionsDefinition *def)
 
62
 {
 
63
     ++def->ref;
 
64
@@ -340,8 +358,11 @@
 
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)
 
71
+                {
 
72
                     update_user_time = TRUE;
 
73
+                }
 
74
             } else {
 
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
 
81
@@ -83,6 +83,9 @@
 
82
 gboolean actions_set_shutdown(const gchar *name,
 
83
                               ObActionsShutdownFunc shutdown);
 
84
 
 
85
+gboolean actions_set_modifies_focused_window(const gchar *name,
 
86
+                                             gboolean modifies);
 
87
+
 
88
 ObActionsAct* actions_parse(xmlNodePtr node);
 
89
 ObActionsAct* actions_parse_string(const gchar *name);
 
90
 
 
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
 
95
@@ -33,6 +33,7 @@
 
96
 {
 
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);
 
100
 
 
101
     client_add_destroy_notify(client_dest, NULL);
 
102
 }
 
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
 
107
@@ -26,7 +26,7 @@
 
108
 
 
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 */
 
113
 
 
114
 /*! The last user-interaction time, as given by the clients */
 
115
 extern Time event_last_user_time;