Merge lp:~kaihengfeng/unity-settings-daemon/16.04-sru-fix-1571640 into lp:unity-settings-daemon/16.04

Proposed by Kai-Heng Feng
Status: Rejected
Rejected by: Sebastien Bacher
Proposed branch: lp:~kaihengfeng/unity-settings-daemon/16.04-sru-fix-1571640
Merge into: lp:unity-settings-daemon/16.04
Diff against target: 138 lines (+53/-4)
2 files modified
debian/changelog (+6/-0)
gnome-settings-daemon/gnome-settings-manager.c (+47/-4)
To merge this branch: bzr merge lp:~kaihengfeng/unity-settings-daemon/16.04-sru-fix-1571640
Reviewer Review Type Date Requested Status
Sebastien Bacher Disapprove
Review via email: mp+298104@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

thanks but it's already included in the coming SRU Marco is working on, see https://code.launchpad.net/~unity-settings-daemon-team/unity-settings-daemon/x-sru2/+merge/298668

review: Disapprove

Unmerged revisions

4133. By Kai-Heng Feng

SettingsManager: Queue up signals before getting D-Bus connection. (LP: #1571640)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2016-02-09 10:03:46 +0000
+++ debian/changelog 2016-06-22 08:33:17 +0000
@@ -1,3 +1,9 @@
1unity-settings-daemon (15.04.1+16.04.20160209-0ubuntu2) xenial; urgency=medium
2
3 * SettingsManager: Queue up signals before getting D-Bus connection. (LP: #1571640)
4
5 -- Kai-Heng Feng <kai.heng.feng@canonical.com> Wed, 22 Jun 2016 15:19:33 +0800
6
1unity-settings-daemon (15.04.1+16.04.20160209-0ubuntu1) xenial; urgency=medium7unity-settings-daemon (15.04.1+16.04.20160209-0ubuntu1) xenial; urgency=medium
28
3 * Restore the scaling on the greeter, the menu placement is correct9 * Restore the scaling on the greeter, the menu placement is correct
410
=== modified file 'gnome-settings-daemon/gnome-settings-manager.c'
--- gnome-settings-daemon/gnome-settings-manager.c 2014-06-26 00:02:19 +0000
+++ gnome-settings-daemon/gnome-settings-manager.c 2016-06-22 08:33:17 +0000
@@ -55,6 +55,11 @@
55" </interface>"55" </interface>"
56"</node>";56"</node>";
5757
58typedef struct {
59 const char *signal;
60 const char *name;
61} SignalCache;
62
58struct GnomeSettingsManagerPrivate63struct GnomeSettingsManagerPrivate
59{64{
60 guint owner_id;65 guint owner_id;
@@ -64,6 +69,7 @@
64 char **whitelist;69 char **whitelist;
65 GsdPnpIds *pnp_ids;70 GsdPnpIds *pnp_ids;
66 GSList *plugins;71 GSList *plugins;
72 GQueue *signal_queue;
67};73};
6874
69static void gnome_settings_manager_class_init (GnomeSettingsManagerClass *klass);75static void gnome_settings_manager_class_init (GnomeSettingsManagerClass *klass);
@@ -74,6 +80,17 @@
7480
75static gpointer manager_object = NULL;81static gpointer manager_object = NULL;
7682
83static void signal_cache_free (SignalCache *cache)
84{
85 if (cache == NULL) {
86 return;
87 }
88
89 g_free (cache->signal);
90 g_free (cache->name);
91 g_free (cache);
92}
93
77GQuark94GQuark
78gnome_settings_manager_error_quark (void)95gnome_settings_manager_error_quark (void)
79{96{
@@ -137,17 +154,23 @@
137 const char *name)154 const char *name)
138{155{
139 GError *error = NULL;156 GError *error = NULL;
157 GQueue *signal_queue = manager->priv->signal_queue;
140158
141 /* FIXME: maybe we should queue those up until the D-Bus159 /* Queue up signal if there's no D-Bus connection */
142 * connection is available... */160 if (manager->priv->connection == NULL) {
143 if (manager->priv->connection == NULL)161 g_debug ("Connection is null, cannot emit signal, queue instead");
162 SignalCache *cache = g_new0 (SignalCache, 1);
163 cache->signal = g_strdup (signal);
164 cache->name = g_strdup (name);
165 g_queue_push_tail (signal_queue, cache);
144 return;166 return;
167 }
145168
146 if (g_dbus_connection_emit_signal (manager->priv->connection,169 if (g_dbus_connection_emit_signal (manager->priv->connection,
147 NULL,170 NULL,
148 GSD_DBUS_PATH,171 GSD_DBUS_PATH,
149 GSD_DBUS_NAME,172 GSD_DBUS_NAME,
150 "PluginActivated",173 signal,
151 g_variant_new ("(s)", name),174 g_variant_new ("(s)", name),
152 &error) == FALSE) {175 &error) == FALSE) {
153 g_debug ("Error emitting signal: %s", error->message);176 g_debug ("Error emitting signal: %s", error->message);
@@ -344,6 +367,7 @@
344{367{
345 GDBusConnection *connection;368 GDBusConnection *connection;
346 GError *error = NULL;369 GError *error = NULL;
370 GQueue *signal_queue = manager->priv->signal_queue;
347371
348 connection = g_bus_get_finish (res, &error);372 connection = g_bus_get_finish (res, &error);
349 if (connection == NULL) {373 if (connection == NULL) {
@@ -351,6 +375,7 @@
351 g_error_free (error);375 g_error_free (error);
352 return;376 return;
353 }377 }
378
354 manager->priv->connection = connection;379 manager->priv->connection = connection;
355380
356 g_dbus_connection_register_object (connection,381 g_dbus_connection_register_object (connection,
@@ -360,6 +385,16 @@
360 NULL,385 NULL,
361 NULL,386 NULL,
362 NULL);387 NULL);
388
389 /* Emit queued up signals after got D-Bus connection */
390 if (!g_queue_is_empty (signal_queue)) {
391 g_debug ("Emit queued up signals");
392 while (!g_queue_is_empty (signal_queue)) {
393 SignalCache *cache = g_queue_pop_head (signal_queue);
394 emit_signal (manager, cache->signal, cache->name);
395 signal_cache_free (cache);
396 }
397 }
363}398}
364399
365static void400static void
@@ -396,6 +431,8 @@
396 goto out;431 goto out;
397 }432 }
398433
434 manager->priv->signal_queue = g_queue_new ();
435
399 g_debug ("loading PNPIDs");436 g_debug ("loading PNPIDs");
400 manager->priv->pnp_ids = gsd_pnp_ids_new ();437 manager->priv->pnp_ids = gsd_pnp_ids_new ();
401438
@@ -425,6 +462,12 @@
425 manager->priv->owner_id = 0;462 manager->priv->owner_id = 0;
426 }463 }
427464
465 /* This will be called from both stop_manager and dispose, so we need to
466 * prevent the queue being freed twice */
467 if (manager->priv->signal_queue != NULL) {
468 g_queue_free_full (manager->priv->signal_queue, signal_cache_free);
469 manager->priv->signal_queue = NULL;
470 }
428 g_clear_pointer (&manager->priv->whitelist, g_strfreev);471 g_clear_pointer (&manager->priv->whitelist, g_strfreev);
429 g_clear_object (&manager->priv->settings);472 g_clear_object (&manager->priv->settings);
430 g_clear_object (&manager->priv->pnp_ids);473 g_clear_object (&manager->priv->pnp_ids);

Subscribers

People subscribed via source and target branches