Merge lp:~attente/gnome-settings-daemon/gnome-key-grabber into lp:~ubuntu-desktop/gnome-settings-daemon/ubuntu

Proposed by William Hua on 2014-01-22
Status: Rejected
Rejected by: Sebastien Bacher on 2014-02-26
Proposed branch: lp:~attente/gnome-settings-daemon/gnome-key-grabber
Merge into: lp:~ubuntu-desktop/gnome-settings-daemon/ubuntu
Diff against target: 256 lines (+58/-29)
3 files modified
debian/changelog (+9/-0)
debian/patches/fix_input_switching_on_unity.patch (+13/-12)
debian/patches/fix_media_keys_on_unity.patch (+36/-17)
To merge this branch: bzr merge lp:~attente/gnome-settings-daemon/gnome-key-grabber
Reviewer Review Type Date Requested Status
Sebastien Bacher 2014-01-22 Disapprove on 2014-02-26
Review via email: mp+202758@code.launchpad.net

Commit message

Use the GNOME key grabber interface under Unity.

Description of the change

(This branch depends on https://code.launchpad.net/~attente/unity/gnome-key-grabber/+merge/202755)

Use the GNOME key grabber interface under Unity.

To post a comment you must log in.
453. By William Hua on 2014-02-04

Merge trunk.

454. By William Hua on 2014-02-07

Merge trunk.

Sebastien Bacher (seb128) wrote :

Thanks William, I guess we need the new compiz to land before merging that one. Could you also/instead target lp:unity-settings-daemon (it's our "fork" of g-s-d for Unity)? (I wonder if we can just drop the key grabber there, following upstream move, since u-s-d is specific to Unity and compiz is the only option there)

455. By William Hua on 2014-02-14

Merge trunk.

Sebastien Bacher (seb128) wrote :

setting as rejected, that landing in u-s-d, g-s-d is not used under Unity anymore and that code is going to be cleaned out

review: Disapprove

Unmerged revisions

455. By William Hua on 2014-02-14

Merge trunk.

454. By William Hua on 2014-02-07

Merge trunk.

453. By William Hua on 2014-02-04

Merge trunk.

452. By William Hua on 2014-01-03

* debian/patches/fix_input_switching_on_unity.patch:
  - Update the current input source under Unity.
* debian/patches/fix_media_keys_on_unity.patch:
  - Stop using the legacy key grabber under Unity.

451. By William Hua on 2013-12-30

Handle input switching if under Unity.

450. By William Hua on 2013-12-24

Use shell key grabber under Unity.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-02-07 17:05:59 +0000
3+++ debian/changelog 2014-02-14 14:33:12 +0000
4@@ -1,3 +1,12 @@
5+gnome-settings-daemon (3.8.6.1-0ubuntu9) UNRELEASED; urgency=medium
6+
7+ * debian/patches/fix_input_switching_on_unity.patch:
8+ - Update the current input source under Unity.
9+ * debian/patches/fix_media_keys_on_unity.patch:
10+ - Stop using the legacy key grabber under Unity.
11+
12+ -- William Hua <william.hua@canonical.com> Fri, 14 Feb 2014 09:32:18 -0500
13+
14 gnome-settings-daemon (3.8.6.1-0ubuntu8) trusty; urgency=medium
15
16 * I hate control.in files.
17
18=== modified file 'debian/patches/fix_input_switching_on_unity.patch'
19--- debian/patches/fix_input_switching_on_unity.patch 2013-10-15 11:04:41 +0000
20+++ debian/patches/fix_input_switching_on_unity.patch 2014-02-14 14:33:12 +0000
21@@ -11,10 +11,10 @@
22 plugins/media-keys/shortcuts-list.h | 6 +++
23 2 files changed, 64 insertions(+), 1 deletion(-)
24
25-Index: b/plugins/media-keys/gsd-media-keys-manager.c
26+Index: gnome-settings-daemon-3.8.6.1/plugins/media-keys/gsd-media-keys-manager.c
27 ===================================================================
28---- a/plugins/media-keys/gsd-media-keys-manager.c
29-+++ b/plugins/media-keys/gsd-media-keys-manager.c
30+--- gnome-settings-daemon-3.8.6.1.orig/plugins/media-keys/gsd-media-keys-manager.c 2013-12-29 22:56:03.194718298 -0500
31++++ gnome-settings-daemon-3.8.6.1/plugins/media-keys/gsd-media-keys-manager.c 2013-12-29 23:01:32.050734214 -0500
32 @@ -114,6 +114,10 @@
33 #define VOLUME_STEP 6 /* percents for one volume button press */
34 #define MAX_VOLUME 65536.0
35@@ -34,7 +34,7 @@
36 GHashTable *custom_settings;
37
38 GPtrArray *keys;
39-@@ -530,7 +535,9 @@
40+@@ -528,7 +533,9 @@
41 get_key_string (GsdMediaKeysManager *manager,
42 MediaKey *key)
43 {
44@@ -45,7 +45,7 @@
45 return g_settings_get_string (manager->priv->settings, key->settings_key);
46 else if (key->hard_coded != NULL)
47 return g_strdup (key->hard_coded);
48-@@ -2111,6 +2118,44 @@
49+@@ -2109,6 +2116,45 @@
50 * are not used in this context */
51 break;
52 }
53@@ -60,7 +60,8 @@
54 + GVariant *sources;
55 + gint i, n;
56 +
57-+ if (!manager->priv->have_legacy_keygrabber)
58++ if (!manager->priv->have_legacy_keygrabber &&
59++ g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "ubuntu") != 0)
60 + return;
61 +
62 + settings = g_settings_new (GNOME_DESKTOP_INPUT_SOURCES_DIR);
63@@ -90,7 +91,7 @@
64 }
65
66 static void
67-@@ -2451,6 +2496,10 @@
68+@@ -2449,6 +2495,10 @@
69 case BATTERY_KEY:
70 do_battery_action (manager);
71 break;
72@@ -101,7 +102,7 @@
73 /* Note, no default so compiler catches missing keys */
74 case CUSTOM_KEY:
75 g_assert_not_reached ();
76-@@ -2773,6 +2822,12 @@
77+@@ -2770,6 +2820,12 @@
78 g_signal_connect (G_OBJECT (manager->priv->settings), "changed::custom-keybindings",
79 G_CALLBACK (gsettings_custom_changed_cb), manager);
80
81@@ -114,7 +115,7 @@
82 manager->priv->custom_settings =
83 g_hash_table_new_full (g_str_hash, g_str_equal,
84 g_free, g_object_unref);
85-@@ -2903,6 +2958,7 @@
86+@@ -2889,6 +2945,7 @@
87
88 g_clear_object (&priv->logind_proxy);
89 g_clear_object (&priv->settings);
90@@ -122,10 +123,10 @@
91 g_clear_object (&priv->power_settings);
92 g_clear_object (&priv->power_proxy);
93 g_clear_object (&priv->power_screen_proxy);
94-Index: b/plugins/media-keys/shortcuts-list.h
95+Index: gnome-settings-daemon-3.8.6.1/plugins/media-keys/shortcuts-list.h
96 ===================================================================
97---- a/plugins/media-keys/shortcuts-list.h
98-+++ b/plugins/media-keys/shortcuts-list.h
99+--- gnome-settings-daemon-3.8.6.1.orig/plugins/media-keys/shortcuts-list.h 2013-12-29 22:56:03.194718298 -0500
100++++ gnome-settings-daemon-3.8.6.1/plugins/media-keys/shortcuts-list.h 2013-12-29 22:56:03.190718298 -0500
101 @@ -25,6 +25,7 @@
102 #include "gsd-keygrab.h"
103
104
105=== modified file 'debian/patches/fix_media_keys_on_unity.patch'
106--- debian/patches/fix_media_keys_on_unity.patch 2013-10-29 17:00:32 +0000
107+++ debian/patches/fix_media_keys_on_unity.patch 2014-02-14 14:33:12 +0000
108@@ -7,8 +7,10 @@
109 9e032789283dd5aa7c13411c538af3e4032f3145
110 Author: Tim Lunn <tim@feathertop.org>
111 Last-Update: <2013-04-25>
112---- a/plugins/media-keys/gsd-media-keys-manager.c
113-+++ b/plugins/media-keys/gsd-media-keys-manager.c
114+Index: gnome-settings-daemon-3.8.6.1/plugins/media-keys/gsd-media-keys-manager.c
115+===================================================================
116+--- gnome-settings-daemon-3.8.6.1.orig/plugins/media-keys/gsd-media-keys-manager.c 2013-12-24 00:32:02.943895026 -0500
117++++ gnome-settings-daemon-3.8.6.1/plugins/media-keys/gsd-media-keys-manager.c 2013-12-24 00:42:38.643925792 -0500
118 @@ -78,6 +78,10 @@
119 #define SHELL_DBUS_NAME "org.gnome.Shell"
120 #define SHELL_DBUS_PATH "/org/gnome/Shell"
121@@ -349,17 +351,32 @@
122 static void
123 on_accelerator_activated (ShellKeyGrabber *grabber,
124 guint accel_id,
125-@@ -2448,6 +2662,9 @@
126+@@ -2442,12 +2656,24 @@
127+ init_kbd (manager);
128+ }
129+
130++static gboolean
131++use_shell_key_grabber (void)
132++{
133++ const gchar *session = g_getenv ("DESKTOP_SESSION");
134++
135++ return (g_strcmp0 (session, "gnome") == 0 ||
136++ g_strcmp0 (session, "ubuntu") == 0);
137++}
138++
139+ static void
140+ on_shell_appeared (GDBusConnection *connection,
141+ const char *name,
142 const char *name_owner,
143 gpointer user_data)
144 {
145-+ if (g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "gnome") != 0)
146++ if (!use_shell_key_grabber ())
147 + return;
148 +
149 GsdMediaKeysManager *manager = user_data;
150
151 shell_key_grabber_proxy_new_for_bus (G_BUS_TYPE_SESSION,
152-@@ -2467,10 +2684,57 @@
153+@@ -2467,10 +2693,57 @@
154 }
155
156 static void
157@@ -367,7 +384,7 @@
158 +{
159 + GSList *l;
160 +
161-+ if (g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "gnome") == 0)
162++ if (use_shell_key_grabber ())
163 + return;
164 +
165 + manager->priv->have_legacy_keygrabber = TRUE;
166@@ -397,7 +414,7 @@
167 +static void
168 +maybe_stop_legacy_grabber (GsdMediaKeysManager *manager)
169 +{
170-+ if (g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "gnome") == 0)
171++ if (use_shell_key_grabber ())
172 + return;
173 +
174 + manager->priv->have_legacy_keygrabber = FALSE;
175@@ -411,13 +428,13 @@
176 const char *name,
177 gpointer user_data)
178 {
179-+ if (g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "gnome") != 0)
180++ if (!use_shell_key_grabber ())
181 + return;
182 +
183 GsdMediaKeysManager *manager = user_data;
184
185 g_ptr_array_set_size (manager->priv->keys, 0);
186-@@ -2531,6 +2795,7 @@
187+@@ -2531,6 +2804,7 @@
188 }
189 manager->priv->icon_theme = g_settings_get_string (manager->priv->interface_settings, "icon-theme");
190
191@@ -425,7 +442,7 @@
192 ensure_cancellable (&manager->priv->grab_cancellable);
193 ensure_cancellable (&manager->priv->shell_cancellable);
194
195-@@ -2541,6 +2806,8 @@
196+@@ -2541,6 +2815,8 @@
197 on_shell_vanished,
198 manager, NULL);
199
200@@ -434,7 +451,7 @@
201 gnome_settings_profile_end (NULL);
202
203 manager->priv->start_idle_id = 0;
204-@@ -2556,6 +2823,11 @@
205+@@ -2556,6 +2832,11 @@
206
207 gnome_settings_profile_start (NULL);
208
209@@ -446,7 +463,7 @@
210 #ifdef HAVE_GUDEV
211 manager->priv->streams = g_hash_table_new (g_direct_hash, g_direct_equal);
212 manager->priv->udev_client = g_udev_client_new (subsystems);
213-@@ -2574,6 +2846,7 @@
214+@@ -2574,6 +2855,7 @@
215 gsd_media_keys_manager_stop (GsdMediaKeysManager *manager)
216 {
217 GsdMediaKeysManagerPrivate *priv = manager->priv;
218@@ -454,7 +471,7 @@
219 int i;
220
221 g_debug ("Stopping media_keys manager");
222-@@ -2584,6 +2857,15 @@
223+@@ -2584,6 +2866,15 @@
224 priv->bus_cancellable = NULL;
225 }
226
227@@ -470,7 +487,7 @@
228 if (manager->priv->gtksettings != NULL) {
229 g_signal_handlers_disconnect_by_func (manager->priv->gtksettings, sound_theme_changed, manager);
230 manager->priv->gtksettings = NULL;
231-@@ -2635,16 +2917,26 @@
232+@@ -2635,16 +2926,26 @@
233 }
234
235 if (priv->keys != NULL) {
236@@ -498,7 +515,7 @@
237 if (priv->grab_cancellable != NULL) {
238 g_cancellable_cancel (priv->grab_cancellable);
239 g_clear_object (&priv->grab_cancellable);
240-@@ -2655,6 +2947,7 @@
241+@@ -2655,6 +2956,7 @@
242 g_clear_object (&priv->shell_cancellable);
243 }
244
245@@ -506,8 +523,10 @@
246 g_clear_object (&priv->sink);
247 g_clear_object (&priv->source);
248 g_clear_object (&priv->volume);
249---- a/plugins/media-keys/shortcuts-list.h
250-+++ b/plugins/media-keys/shortcuts-list.h
251+Index: gnome-settings-daemon-3.8.6.1/plugins/media-keys/shortcuts-list.h
252+===================================================================
253+--- gnome-settings-daemon-3.8.6.1.orig/plugins/media-keys/shortcuts-list.h 2013-12-24 00:32:02.943895026 -0500
254++++ gnome-settings-daemon-3.8.6.1/plugins/media-keys/shortcuts-list.h 2013-12-24 00:32:33.000000000 -0500
255 @@ -22,6 +22,7 @@
256 #define __SHORTCUTS_LIST_H__
257

Subscribers

People subscribed via source and target branches

to all changes: