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

Proposed by William Hua
Status: Rejected
Rejected by: Sebastien Bacher
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 Disapprove
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

Merge trunk.

454. By William Hua

Merge trunk.

Revision history for this message
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

Merge trunk.

Revision history for this message
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

Merge trunk.

454. By William Hua

Merge trunk.

453. By William Hua

Merge trunk.

452. By William Hua

* 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

Handle input switching if under Unity.

450. By William Hua

Use shell key grabber under Unity.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2014-02-07 17:05:59 +0000
+++ debian/changelog 2014-02-14 14:33:12 +0000
@@ -1,3 +1,12 @@
1gnome-settings-daemon (3.8.6.1-0ubuntu9) UNRELEASED; urgency=medium
2
3 * debian/patches/fix_input_switching_on_unity.patch:
4 - Update the current input source under Unity.
5 * debian/patches/fix_media_keys_on_unity.patch:
6 - Stop using the legacy key grabber under Unity.
7
8 -- William Hua <william.hua@canonical.com> Fri, 14 Feb 2014 09:32:18 -0500
9
1gnome-settings-daemon (3.8.6.1-0ubuntu8) trusty; urgency=medium10gnome-settings-daemon (3.8.6.1-0ubuntu8) trusty; urgency=medium
211
3 * I hate control.in files.12 * I hate control.in files.
413
=== modified file 'debian/patches/fix_input_switching_on_unity.patch'
--- debian/patches/fix_input_switching_on_unity.patch 2013-10-15 11:04:41 +0000
+++ debian/patches/fix_input_switching_on_unity.patch 2014-02-14 14:33:12 +0000
@@ -11,10 +11,10 @@
11 plugins/media-keys/shortcuts-list.h | 6 +++11 plugins/media-keys/shortcuts-list.h | 6 +++
12 2 files changed, 64 insertions(+), 1 deletion(-)12 2 files changed, 64 insertions(+), 1 deletion(-)
1313
14Index: b/plugins/media-keys/gsd-media-keys-manager.c14Index: gnome-settings-daemon-3.8.6.1/plugins/media-keys/gsd-media-keys-manager.c
15===================================================================15===================================================================
16--- a/plugins/media-keys/gsd-media-keys-manager.c16--- gnome-settings-daemon-3.8.6.1.orig/plugins/media-keys/gsd-media-keys-manager.c 2013-12-29 22:56:03.194718298 -0500
17+++ b/plugins/media-keys/gsd-media-keys-manager.c17+++ gnome-settings-daemon-3.8.6.1/plugins/media-keys/gsd-media-keys-manager.c 2013-12-29 23:01:32.050734214 -0500
18@@ -114,6 +114,10 @@18@@ -114,6 +114,10 @@
19 #define VOLUME_STEP 6 /* percents for one volume button press */19 #define VOLUME_STEP 6 /* percents for one volume button press */
20 #define MAX_VOLUME 65536.020 #define MAX_VOLUME 65536.0
@@ -34,7 +34,7 @@
34 GHashTable *custom_settings;34 GHashTable *custom_settings;
35 35
36 GPtrArray *keys;36 GPtrArray *keys;
37@@ -530,7 +535,9 @@37@@ -528,7 +533,9 @@
38 get_key_string (GsdMediaKeysManager *manager,38 get_key_string (GsdMediaKeysManager *manager,
39 MediaKey *key)39 MediaKey *key)
40 {40 {
@@ -45,7 +45,7 @@
45 return g_settings_get_string (manager->priv->settings, key->settings_key);45 return g_settings_get_string (manager->priv->settings, key->settings_key);
46 else if (key->hard_coded != NULL)46 else if (key->hard_coded != NULL)
47 return g_strdup (key->hard_coded);47 return g_strdup (key->hard_coded);
48@@ -2111,6 +2118,44 @@48@@ -2109,6 +2116,45 @@
49 * are not used in this context */49 * are not used in this context */
50 break;50 break;
51 }51 }
@@ -60,7 +60,8 @@
60+ GVariant *sources;60+ GVariant *sources;
61+ gint i, n;61+ gint i, n;
62+62+
63+ if (!manager->priv->have_legacy_keygrabber)63+ if (!manager->priv->have_legacy_keygrabber &&
64+ g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "ubuntu") != 0)
64+ return;65+ return;
65+66+
66+ settings = g_settings_new (GNOME_DESKTOP_INPUT_SOURCES_DIR);67+ settings = g_settings_new (GNOME_DESKTOP_INPUT_SOURCES_DIR);
@@ -90,7 +91,7 @@
90 }91 }
91 92
92 static void93 static void
93@@ -2451,6 +2496,10 @@94@@ -2449,6 +2495,10 @@
94 case BATTERY_KEY:95 case BATTERY_KEY:
95 do_battery_action (manager);96 do_battery_action (manager);
96 break;97 break;
@@ -101,7 +102,7 @@
101 /* Note, no default so compiler catches missing keys */102 /* Note, no default so compiler catches missing keys */
102 case CUSTOM_KEY:103 case CUSTOM_KEY:
103 g_assert_not_reached ();104 g_assert_not_reached ();
104@@ -2773,6 +2822,12 @@105@@ -2770,6 +2820,12 @@
105 g_signal_connect (G_OBJECT (manager->priv->settings), "changed::custom-keybindings",106 g_signal_connect (G_OBJECT (manager->priv->settings), "changed::custom-keybindings",
106 G_CALLBACK (gsettings_custom_changed_cb), manager);107 G_CALLBACK (gsettings_custom_changed_cb), manager);
107 108
@@ -114,7 +115,7 @@
114 manager->priv->custom_settings =115 manager->priv->custom_settings =
115 g_hash_table_new_full (g_str_hash, g_str_equal,116 g_hash_table_new_full (g_str_hash, g_str_equal,
116 g_free, g_object_unref);117 g_free, g_object_unref);
117@@ -2903,6 +2958,7 @@118@@ -2889,6 +2945,7 @@
118 119
119 g_clear_object (&priv->logind_proxy);120 g_clear_object (&priv->logind_proxy);
120 g_clear_object (&priv->settings);121 g_clear_object (&priv->settings);
@@ -122,10 +123,10 @@
122 g_clear_object (&priv->power_settings);123 g_clear_object (&priv->power_settings);
123 g_clear_object (&priv->power_proxy);124 g_clear_object (&priv->power_proxy);
124 g_clear_object (&priv->power_screen_proxy);125 g_clear_object (&priv->power_screen_proxy);
125Index: b/plugins/media-keys/shortcuts-list.h126Index: gnome-settings-daemon-3.8.6.1/plugins/media-keys/shortcuts-list.h
126===================================================================127===================================================================
127--- a/plugins/media-keys/shortcuts-list.h128--- gnome-settings-daemon-3.8.6.1.orig/plugins/media-keys/shortcuts-list.h 2013-12-29 22:56:03.194718298 -0500
128+++ b/plugins/media-keys/shortcuts-list.h129+++ gnome-settings-daemon-3.8.6.1/plugins/media-keys/shortcuts-list.h 2013-12-29 22:56:03.190718298 -0500
129@@ -25,6 +25,7 @@130@@ -25,6 +25,7 @@
130 #include "gsd-keygrab.h"131 #include "gsd-keygrab.h"
131 132
132133
=== modified file 'debian/patches/fix_media_keys_on_unity.patch'
--- debian/patches/fix_media_keys_on_unity.patch 2013-10-29 17:00:32 +0000
+++ debian/patches/fix_media_keys_on_unity.patch 2014-02-14 14:33:12 +0000
@@ -7,8 +7,10 @@
7 9e032789283dd5aa7c13411c538af3e4032f31457 9e032789283dd5aa7c13411c538af3e4032f3145
8Author: Tim Lunn <tim@feathertop.org>8Author: Tim Lunn <tim@feathertop.org>
9Last-Update: <2013-04-25>9Last-Update: <2013-04-25>
10--- a/plugins/media-keys/gsd-media-keys-manager.c10Index: gnome-settings-daemon-3.8.6.1/plugins/media-keys/gsd-media-keys-manager.c
11+++ b/plugins/media-keys/gsd-media-keys-manager.c11===================================================================
12--- gnome-settings-daemon-3.8.6.1.orig/plugins/media-keys/gsd-media-keys-manager.c 2013-12-24 00:32:02.943895026 -0500
13+++ gnome-settings-daemon-3.8.6.1/plugins/media-keys/gsd-media-keys-manager.c 2013-12-24 00:42:38.643925792 -0500
12@@ -78,6 +78,10 @@14@@ -78,6 +78,10 @@
13 #define SHELL_DBUS_NAME "org.gnome.Shell"15 #define SHELL_DBUS_NAME "org.gnome.Shell"
14 #define SHELL_DBUS_PATH "/org/gnome/Shell"16 #define SHELL_DBUS_PATH "/org/gnome/Shell"
@@ -349,17 +351,32 @@
349 static void351 static void
350 on_accelerator_activated (ShellKeyGrabber *grabber,352 on_accelerator_activated (ShellKeyGrabber *grabber,
351 guint accel_id,353 guint accel_id,
352@@ -2448,6 +2662,9 @@354@@ -2442,12 +2656,24 @@
355 init_kbd (manager);
356 }
357
358+static gboolean
359+use_shell_key_grabber (void)
360+{
361+ const gchar *session = g_getenv ("DESKTOP_SESSION");
362+
363+ return (g_strcmp0 (session, "gnome") == 0 ||
364+ g_strcmp0 (session, "ubuntu") == 0);
365+}
366+
367 static void
368 on_shell_appeared (GDBusConnection *connection,
369 const char *name,
353 const char *name_owner,370 const char *name_owner,
354 gpointer user_data)371 gpointer user_data)
355 {372 {
356+ if (g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "gnome") != 0)373+ if (!use_shell_key_grabber ())
357+ return;374+ return;
358+375+
359 GsdMediaKeysManager *manager = user_data;376 GsdMediaKeysManager *manager = user_data;
360 377
361 shell_key_grabber_proxy_new_for_bus (G_BUS_TYPE_SESSION,378 shell_key_grabber_proxy_new_for_bus (G_BUS_TYPE_SESSION,
362@@ -2467,10 +2684,57 @@379@@ -2467,10 +2693,57 @@
363 }380 }
364 381
365 static void382 static void
@@ -367,7 +384,7 @@
367+{384+{
368+ GSList *l;385+ GSList *l;
369+386+
370+ if (g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "gnome") == 0)387+ if (use_shell_key_grabber ())
371+ return;388+ return;
372+389+
373+ manager->priv->have_legacy_keygrabber = TRUE;390+ manager->priv->have_legacy_keygrabber = TRUE;
@@ -397,7 +414,7 @@
397+static void414+static void
398+maybe_stop_legacy_grabber (GsdMediaKeysManager *manager)415+maybe_stop_legacy_grabber (GsdMediaKeysManager *manager)
399+{416+{
400+ if (g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "gnome") == 0)417+ if (use_shell_key_grabber ())
401+ return;418+ return;
402+419+
403+ manager->priv->have_legacy_keygrabber = FALSE;420+ manager->priv->have_legacy_keygrabber = FALSE;
@@ -411,13 +428,13 @@
411 const char *name,428 const char *name,
412 gpointer user_data)429 gpointer user_data)
413 {430 {
414+ if (g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "gnome") != 0)431+ if (!use_shell_key_grabber ())
415+ return;432+ return;
416+433+
417 GsdMediaKeysManager *manager = user_data;434 GsdMediaKeysManager *manager = user_data;
418 435
419 g_ptr_array_set_size (manager->priv->keys, 0);436 g_ptr_array_set_size (manager->priv->keys, 0);
420@@ -2531,6 +2795,7 @@437@@ -2531,6 +2804,7 @@
421 }438 }
422 manager->priv->icon_theme = g_settings_get_string (manager->priv->interface_settings, "icon-theme");439 manager->priv->icon_theme = g_settings_get_string (manager->priv->interface_settings, "icon-theme");
423 440
@@ -425,7 +442,7 @@
425 ensure_cancellable (&manager->priv->grab_cancellable);442 ensure_cancellable (&manager->priv->grab_cancellable);
426 ensure_cancellable (&manager->priv->shell_cancellable);443 ensure_cancellable (&manager->priv->shell_cancellable);
427 444
428@@ -2541,6 +2806,8 @@445@@ -2541,6 +2815,8 @@
429 on_shell_vanished,446 on_shell_vanished,
430 manager, NULL);447 manager, NULL);
431 448
@@ -434,7 +451,7 @@
434 gnome_settings_profile_end (NULL);451 gnome_settings_profile_end (NULL);
435 452
436 manager->priv->start_idle_id = 0;453 manager->priv->start_idle_id = 0;
437@@ -2556,6 +2823,11 @@454@@ -2556,6 +2832,11 @@
438 455
439 gnome_settings_profile_start (NULL);456 gnome_settings_profile_start (NULL);
440 457
@@ -446,7 +463,7 @@
446 #ifdef HAVE_GUDEV463 #ifdef HAVE_GUDEV
447 manager->priv->streams = g_hash_table_new (g_direct_hash, g_direct_equal);464 manager->priv->streams = g_hash_table_new (g_direct_hash, g_direct_equal);
448 manager->priv->udev_client = g_udev_client_new (subsystems);465 manager->priv->udev_client = g_udev_client_new (subsystems);
449@@ -2574,6 +2846,7 @@466@@ -2574,6 +2855,7 @@
450 gsd_media_keys_manager_stop (GsdMediaKeysManager *manager)467 gsd_media_keys_manager_stop (GsdMediaKeysManager *manager)
451 {468 {
452 GsdMediaKeysManagerPrivate *priv = manager->priv;469 GsdMediaKeysManagerPrivate *priv = manager->priv;
@@ -454,7 +471,7 @@
454 int i;471 int i;
455 472
456 g_debug ("Stopping media_keys manager");473 g_debug ("Stopping media_keys manager");
457@@ -2584,6 +2857,15 @@474@@ -2584,6 +2866,15 @@
458 priv->bus_cancellable = NULL;475 priv->bus_cancellable = NULL;
459 }476 }
460 477
@@ -470,7 +487,7 @@
470 if (manager->priv->gtksettings != NULL) {487 if (manager->priv->gtksettings != NULL) {
471 g_signal_handlers_disconnect_by_func (manager->priv->gtksettings, sound_theme_changed, manager);488 g_signal_handlers_disconnect_by_func (manager->priv->gtksettings, sound_theme_changed, manager);
472 manager->priv->gtksettings = NULL;489 manager->priv->gtksettings = NULL;
473@@ -2635,16 +2917,26 @@490@@ -2635,16 +2926,26 @@
474 }491 }
475 492
476 if (priv->keys != NULL) {493 if (priv->keys != NULL) {
@@ -498,7 +515,7 @@
498 if (priv->grab_cancellable != NULL) {515 if (priv->grab_cancellable != NULL) {
499 g_cancellable_cancel (priv->grab_cancellable);516 g_cancellable_cancel (priv->grab_cancellable);
500 g_clear_object (&priv->grab_cancellable);517 g_clear_object (&priv->grab_cancellable);
501@@ -2655,6 +2947,7 @@518@@ -2655,6 +2956,7 @@
502 g_clear_object (&priv->shell_cancellable);519 g_clear_object (&priv->shell_cancellable);
503 }520 }
504 521
@@ -506,8 +523,10 @@
506 g_clear_object (&priv->sink);523 g_clear_object (&priv->sink);
507 g_clear_object (&priv->source);524 g_clear_object (&priv->source);
508 g_clear_object (&priv->volume);525 g_clear_object (&priv->volume);
509--- a/plugins/media-keys/shortcuts-list.h526Index: gnome-settings-daemon-3.8.6.1/plugins/media-keys/shortcuts-list.h
510+++ b/plugins/media-keys/shortcuts-list.h527===================================================================
528--- gnome-settings-daemon-3.8.6.1.orig/plugins/media-keys/shortcuts-list.h 2013-12-24 00:32:02.943895026 -0500
529+++ gnome-settings-daemon-3.8.6.1/plugins/media-keys/shortcuts-list.h 2013-12-24 00:32:33.000000000 -0500
511@@ -22,6 +22,7 @@530@@ -22,6 +22,7 @@
512 #define __SHORTCUTS_LIST_H__531 #define __SHORTCUTS_LIST_H__
513 532

Subscribers

People subscribed via source and target branches

to all changes: