Merge lp:~unity-settings-daemon-team/unity-settings-daemon/x-sru2 into lp:unity-settings-daemon/16.04

Proposed by Marco Trevisan (Treviño) on 2016-06-29
Status: Merged
Approved by: Sebastien Bacher on 2016-07-05
Approved revision: 4142
Merged at revision: 4134
Proposed branch: lp:~unity-settings-daemon-team/unity-settings-daemon/x-sru2
Merge into: lp:unity-settings-daemon/16.04
Diff against target: 2307 lines (+977/-420)
25 files modified
debian/changelog (+30/-0)
gnome-settings-daemon/Makefile.am (+34/-3)
gnome-settings-daemon/gnome-settings-bus.c (+89/-0)
gnome-settings-daemon/gnome-settings-bus.h (+36/-0)
gnome-settings-daemon/gnome-settings-manager.c (+47/-4)
gnome-settings-daemon/gnome-settings-session.c (+0/-62)
gnome-settings-daemon/gnome-settings-session.h (+0/-34)
gnome-settings-daemon/main.c (+2/-2)
gnome-settings-daemon/org.gnome.ScreenSaver.xml (+43/-0)
gnome-settings-daemon/org.gnome.SessionManager.xml (+451/-0)
plugins/automount/gsd-automount-manager.c (+19/-45)
plugins/background/gsd-background-manager.c (+2/-2)
plugins/color/gsd-color-manager.c (+5/-3)
plugins/common/gsd-input-helper.c (+3/-0)
plugins/keyboard/gsd-keyboard-manager.c (+1/-1)
plugins/media-keys/gsd-media-keys-manager.c (+31/-18)
plugins/power/gsd-power-manager.c (+78/-162)
plugins/remote-display/gsd-remote-display-manager.c (+1/-1)
plugins/screensaver-proxy/gsd-screensaver-proxy-manager.c (+54/-34)
plugins/smartcard/gsd-smartcard-plugin.c (+8/-37)
plugins/updates/gsd-updates-manager.c (+5/-5)
plugins/updates/gsd-updates-refresh.c (+5/-5)
plugins/wacom/gsd-wacom-manager.c (+8/-0)
plugins/xrandr/gsd-xrandr-manager.c (+1/-1)
plugins/xsettings/gsd-xsettings-manager.c (+24/-1)
To merge this branch: bzr merge lp:~unity-settings-daemon-team/unity-settings-daemon/x-sru2
Reviewer Review Type Date Requested Status
Sebastien Bacher 2016-06-29 Approve on 2016-06-29
Review via email: mp+298668@code.launchpad.net

Commit message

Releasing SRU2 for Xenial

To post a comment you must log in.
Sebastien Bacher (seb128) wrote :

looks good but we should probably revert r4141 which is a behaviour change and arguable for a SRU

review: Needs Fixing
Marco Trevisan (Treviño) (3v1n0) wrote :

Removed as requested

Sebastien Bacher (seb128) wrote :

thanks

review: Approve

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 2016-06-29 15:38:15 +0000
3+++ debian/changelog 2016-06-29 16:17:06 +0000
4@@ -1,3 +1,33 @@
5+unity-settings-daemon (15.04.1+16.04.20160209-0ubuntu3) UNRELEASED; urgency=medium
6+
7+ [ Robert Ancell ]
8+ * Correctly check value of XDG_CURRENT_DESKTOP.
9+
10+ [ Marco Trevisan (Treviño) ]
11+ * PowerManager: connect to keyboard BrightnessChanged signal to update
12+ the cached current value properly (LP: #1510344)
13+ * GsdPowerManager: don't cache kbd backlight current value (LP:
14+ #1583861)
15+ * common: backport g-s-d commits for having single shared dbus proxies
16+ * ScreensaverProxy: redirect supported calls to gnome screensaver APIs
17+ (LP: #1415265, LP: #1584161)
18+
19+ [ Sebastien Bacher ]
20+ * Don't hit an xerror when a device is removed while being configured
21+ (LP: #1503758)
22+ * wacom: don't segfault when a device is removed while being
23+ configured. (LP: #1439427)
24+
25+ [ Marco Trevisan (Treviño) ]
26+ * GsdPowerManager: use proper return value for upower_kbd_toggle
27+ wherever we use it (LP: #1592816)
28+
29+ [ Kai-Heng Feng ]
30+ * SettingsManager: Queue up signals before getting D-Bus connection.
31+ (LP: #1571640)
32+
33+ -- Robert Ancell <robert.ancell@canonical.com> Wed, 29 Jun 2016 18:16:22 +0200
34+
35 unity-settings-daemon (15.04.1+16.04.20160209-0ubuntu2) xenial; urgency=medium
36
37 * plugins/power/gsd-power-manager.c:
38
39=== modified file 'gnome-settings-daemon/Makefile.am'
40--- gnome-settings-daemon/Makefile.am 2014-10-07 01:58:12 +0000
41+++ gnome-settings-daemon/Makefile.am 2016-06-29 16:17:06 +0000
42@@ -1,4 +1,5 @@
43 NULL =
44+BUILT_SOURCES = $(NULL)
45
46 INCLUDES = \
47 -DDATADIR=\""$(datadir)"\" \
48@@ -80,11 +81,38 @@
49 libgsd.la \
50 $(NULL)
51
52+session_manager_dbus_built_sources = gsd-session-manager-glue.c gsd-session-manager-glue.h
53+BUILT_SOURCES += $(session_manager_dbus_built_sources)
54+
55+$(session_manager_dbus_built_sources) : Makefile.am org.gnome.SessionManager.xml
56+ gdbus-codegen \
57+ --interface-prefix org.gnome.SessionManager. \
58+ --generate-c-code gsd-session-manager-glue \
59+ --c-namespace Gsd \
60+ --annotate "org.gnome.SessionManager" \
61+ "org.gtk.GDBus.C.Name" SessionManager \
62+ $(srcdir)/org.gnome.SessionManager.xml
63+
64+screen_saver_dbus_built_sources = gsd-screen-saver-glue.c gsd-screen-saver-glue.h
65+
66+BUILT_SOURCES += $(screen_saver_dbus_built_sources)
67+
68+$(screen_saver_dbus_built_sources) : Makefile.am org.gnome.ScreenSaver.xml
69+ gdbus-codegen \
70+ --interface-prefix org.gnome.ScreenSaver. \
71+ --generate-c-code gsd-screen-saver-glue \
72+ --c-namespace Gsd \
73+ --annotate "org.gnome.ScreenSaver" \
74+ "org.gtk.GDBus.C.Name" ScreenSaver \
75+ $(srcdir)/org.gnome.ScreenSaver.xml
76+
77 libgsd_la_SOURCES = \
78+ $(session_manager_dbus_built_sources) \
79+ $(screen_saver_dbus_built_sources) \
80 gnome-settings-profile.c \
81 gnome-settings-profile.h \
82- gnome-settings-session.c \
83- gnome-settings-session.h \
84+ gnome-settings-bus.c \
85+ gnome-settings-bus.h \
86 $(NULL)
87
88 libgsd_la_CPPFLAGS = \
89@@ -115,7 +143,10 @@
90
91 EXTRA_DIST = \
92 unity-settings-daemon-localeexec.in \
93- idle-monitor.xml
94+ org.gnome.SessionManager.xml \
95+ org.gnome.ScreenSaver.xml \
96+ idle-monitor.xml \
97+ $(NULL)
98
99 unity-settings-daemon-localeexec: unity-settings-daemon-localeexec.in
100 $(AM_V_GEN) sed -e "s|\@libexecdir\@|$(libexecdir)|" -e "s|\@prefix\@|$(prefix)|" $< > $@.tmp && mv $@.tmp $@
101
102=== added file 'gnome-settings-daemon/gnome-settings-bus.c'
103--- gnome-settings-daemon/gnome-settings-bus.c 1970-01-01 00:00:00 +0000
104+++ gnome-settings-daemon/gnome-settings-bus.c 2016-06-29 16:17:06 +0000
105@@ -0,0 +1,89 @@
106+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
107+ *
108+ * Copyright (C) 2006-2011 Richard Hughes <richard@hughsie.com>
109+ *
110+ * Licensed under the GNU General Public License Version 2
111+ *
112+ * This program is free software; you can redistribute it and/or modify
113+ * it under the terms of the GNU General Public License as published by
114+ * the Free Software Foundation; either version 2 of the License, or
115+ * (at your option) any later version.
116+ *
117+ * This program is distributed in the hope that it will be useful,
118+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
119+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
120+ * GNU General Public License for more details.
121+ *
122+ * You should have received a copy of the GNU General Public License
123+ * along with this program; if not, write to the Free Software
124+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
125+ */
126+
127+#include "config.h"
128+
129+#include <string.h>
130+#include <unistd.h>
131+#include <stdio.h>
132+#include <glib.h>
133+#include <gio/gio.h>
134+
135+#include "gnome-settings-bus.h"
136+
137+#define GNOME_SESSION_DBUS_NAME "org.gnome.SessionManager"
138+#define GNOME_SESSION_DBUS_OBJECT "/org/gnome/SessionManager"
139+
140+#define GNOME_SCREENSAVER_DBUS_NAME "org.gnome.ScreenSaver"
141+#define GNOME_SCREENSAVER_DBUS_OBJECT "/org/gnome/ScreenSaver"
142+
143+GsdSessionManager *
144+gnome_settings_bus_get_session_proxy (void)
145+{
146+ static GsdSessionManager *session_proxy;
147+ GError *error = NULL;
148+
149+ if (session_proxy != NULL) {
150+ g_object_ref (session_proxy);
151+ } else {
152+ session_proxy = gsd_session_manager_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
153+ G_DBUS_PROXY_FLAGS_NONE,
154+ GNOME_SESSION_DBUS_NAME,
155+ GNOME_SESSION_DBUS_OBJECT,
156+ NULL,
157+ &error);
158+ if (error) {
159+ g_warning ("Failed to connect to the session manager: %s", error->message);
160+ g_error_free (error);
161+ } else {
162+ g_object_add_weak_pointer (G_OBJECT (session_proxy), (gpointer*)&session_proxy);
163+ }
164+ }
165+
166+ return session_proxy;
167+}
168+
169+GsdScreenSaver *
170+gnome_settings_bus_get_screen_saver_proxy (void)
171+{
172+ static GsdScreenSaver *screen_saver_proxy;
173+ GError *error = NULL;
174+
175+ if (screen_saver_proxy != NULL) {
176+ g_object_ref (screen_saver_proxy);
177+ } else {
178+ screen_saver_proxy = gsd_screen_saver_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
179+ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
180+ G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
181+ GNOME_SCREENSAVER_DBUS_NAME,
182+ GNOME_SCREENSAVER_DBUS_OBJECT,
183+ NULL,
184+ &error);
185+ if (error) {
186+ g_warning ("Failed to connect to the screen saver: %s", error->message);
187+ g_error_free (error);
188+ } else {
189+ g_object_add_weak_pointer (G_OBJECT (screen_saver_proxy), (gpointer*)&screen_saver_proxy);
190+ }
191+ }
192+
193+ return screen_saver_proxy;
194+}
195
196=== added file 'gnome-settings-daemon/gnome-settings-bus.h'
197--- gnome-settings-daemon/gnome-settings-bus.h 1970-01-01 00:00:00 +0000
198+++ gnome-settings-daemon/gnome-settings-bus.h 2016-06-29 16:17:06 +0000
199@@ -0,0 +1,36 @@
200+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
201+ *
202+ * Copyright (C) 2010-2011 Richard Hughes <richard@hughsie.com>
203+ *
204+ * Licensed under the GNU General Public License Version 2
205+ *
206+ * This program is free software; you can redistribute it and/or modify
207+ * it under the terms of the GNU General Public License as published by
208+ * the Free Software Foundation; either version 2 of the License, or
209+ * (at your option) any later version.
210+ *
211+ * This program is distributed in the hope that it will be useful,
212+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
213+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
214+ * GNU General Public License for more details.
215+ *
216+ * You should have received a copy of the GNU General Public License
217+ * along with this program; if not, write to the Free Software
218+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
219+ */
220+
221+#ifndef __GNOME_SETTINGS_BUS_H
222+#define __GNOME_SETTINGS_BUS_H
223+
224+#include <glib-object.h>
225+#include "gsd-session-manager-glue.h"
226+#include "gsd-screen-saver-glue.h"
227+
228+G_BEGIN_DECLS
229+
230+GsdSessionManager *gnome_settings_bus_get_session_proxy (void);
231+GsdScreenSaver *gnome_settings_bus_get_screen_saver_proxy (void);
232+
233+G_END_DECLS
234+
235+#endif /* __GNOME_SETTINGS_BUS_H */
236
237=== modified file 'gnome-settings-daemon/gnome-settings-manager.c'
238--- gnome-settings-daemon/gnome-settings-manager.c 2014-06-26 00:02:19 +0000
239+++ gnome-settings-daemon/gnome-settings-manager.c 2016-06-29 16:17:06 +0000
240@@ -55,6 +55,11 @@
241 " </interface>"
242 "</node>";
243
244+typedef struct {
245+ const char *signal;
246+ const char *name;
247+} SignalCache;
248+
249 struct GnomeSettingsManagerPrivate
250 {
251 guint owner_id;
252@@ -64,6 +69,7 @@
253 char **whitelist;
254 GsdPnpIds *pnp_ids;
255 GSList *plugins;
256+ GQueue *signal_queue;
257 };
258
259 static void gnome_settings_manager_class_init (GnomeSettingsManagerClass *klass);
260@@ -74,6 +80,17 @@
261
262 static gpointer manager_object = NULL;
263
264+static void signal_cache_free (SignalCache *cache)
265+{
266+ if (cache == NULL) {
267+ return;
268+ }
269+
270+ g_free (cache->signal);
271+ g_free (cache->name);
272+ g_free (cache);
273+}
274+
275 GQuark
276 gnome_settings_manager_error_quark (void)
277 {
278@@ -137,17 +154,23 @@
279 const char *name)
280 {
281 GError *error = NULL;
282+ GQueue *signal_queue = manager->priv->signal_queue;
283
284- /* FIXME: maybe we should queue those up until the D-Bus
285- * connection is available... */
286- if (manager->priv->connection == NULL)
287+ /* Queue up signal if there's no D-Bus connection */
288+ if (manager->priv->connection == NULL) {
289+ g_debug ("Connection is null, cannot emit signal, queue instead");
290+ SignalCache *cache = g_new0 (SignalCache, 1);
291+ cache->signal = g_strdup (signal);
292+ cache->name = g_strdup (name);
293+ g_queue_push_tail (signal_queue, cache);
294 return;
295+ }
296
297 if (g_dbus_connection_emit_signal (manager->priv->connection,
298 NULL,
299 GSD_DBUS_PATH,
300 GSD_DBUS_NAME,
301- "PluginActivated",
302+ signal,
303 g_variant_new ("(s)", name),
304 &error) == FALSE) {
305 g_debug ("Error emitting signal: %s", error->message);
306@@ -344,6 +367,7 @@
307 {
308 GDBusConnection *connection;
309 GError *error = NULL;
310+ GQueue *signal_queue = manager->priv->signal_queue;
311
312 connection = g_bus_get_finish (res, &error);
313 if (connection == NULL) {
314@@ -351,6 +375,7 @@
315 g_error_free (error);
316 return;
317 }
318+
319 manager->priv->connection = connection;
320
321 g_dbus_connection_register_object (connection,
322@@ -360,6 +385,16 @@
323 NULL,
324 NULL,
325 NULL);
326+
327+ /* Emit queued up signals after got D-Bus connection */
328+ if (!g_queue_is_empty (signal_queue)) {
329+ g_debug ("Emit queued up signals");
330+ while (!g_queue_is_empty (signal_queue)) {
331+ SignalCache *cache = g_queue_pop_head (signal_queue);
332+ emit_signal (manager, cache->signal, cache->name);
333+ signal_cache_free (cache);
334+ }
335+ }
336 }
337
338 static void
339@@ -396,6 +431,8 @@
340 goto out;
341 }
342
343+ manager->priv->signal_queue = g_queue_new ();
344+
345 g_debug ("loading PNPIDs");
346 manager->priv->pnp_ids = gsd_pnp_ids_new ();
347
348@@ -425,6 +462,12 @@
349 manager->priv->owner_id = 0;
350 }
351
352+ /* This will be called from both stop_manager and dispose, so we need to
353+ * prevent the queue being freed twice */
354+ if (manager->priv->signal_queue != NULL) {
355+ g_queue_free_full (manager->priv->signal_queue, signal_cache_free);
356+ manager->priv->signal_queue = NULL;
357+ }
358 g_clear_pointer (&manager->priv->whitelist, g_strfreev);
359 g_clear_object (&manager->priv->settings);
360 g_clear_object (&manager->priv->pnp_ids);
361
362=== removed file 'gnome-settings-daemon/gnome-settings-session.c'
363--- gnome-settings-daemon/gnome-settings-session.c 2012-11-12 13:53:19 +0000
364+++ gnome-settings-daemon/gnome-settings-session.c 1970-01-01 00:00:00 +0000
365@@ -1,62 +0,0 @@
366-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
367- *
368- * Copyright (C) 2006-2011 Richard Hughes <richard@hughsie.com>
369- *
370- * Licensed under the GNU General Public License Version 2
371- *
372- * This program is free software; you can redistribute it and/or modify
373- * it under the terms of the GNU General Public License as published by
374- * the Free Software Foundation; either version 2 of the License, or
375- * (at your option) any later version.
376- *
377- * This program is distributed in the hope that it will be useful,
378- * but WITHOUT ANY WARRANTY; without even the implied warranty of
379- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
380- * GNU General Public License for more details.
381- *
382- * You should have received a copy of the GNU General Public License
383- * along with this program; if not, write to the Free Software
384- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
385- */
386-
387-#include "config.h"
388-
389-#include <string.h>
390-#include <unistd.h>
391-#include <stdio.h>
392-#include <glib.h>
393-#include <gio/gio.h>
394-
395-#include "gnome-settings-session.h"
396-
397-#define GNOME_SESSION_DBUS_NAME "org.gnome.SessionManager"
398-#define GNOME_SESSION_DBUS_OBJECT "/org/gnome/SessionManager"
399-#define GNOME_SESSION_DBUS_INTERFACE "org.gnome.SessionManager"
400-
401-GDBusProxy *
402-gnome_settings_session_get_session_proxy (void)
403-{
404- static GDBusProxy *session_proxy;
405- GError *error = NULL;
406-
407- if (session_proxy != NULL) {
408- g_object_ref (session_proxy);
409- } else {
410- session_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
411- G_DBUS_PROXY_FLAGS_NONE,
412- NULL,
413- GNOME_SESSION_DBUS_NAME,
414- GNOME_SESSION_DBUS_OBJECT,
415- GNOME_SESSION_DBUS_INTERFACE,
416- NULL,
417- &error);
418- if (error) {
419- g_warning ("Failed to connect to the session manager: %s", error->message);
420- g_error_free (error);
421- } else {
422- g_object_add_weak_pointer (G_OBJECT (session_proxy), (gpointer*)&session_proxy);
423- }
424- }
425-
426- return session_proxy;
427-}
428
429=== removed file 'gnome-settings-daemon/gnome-settings-session.h'
430--- gnome-settings-daemon/gnome-settings-session.h 2012-11-12 09:12:14 +0000
431+++ gnome-settings-daemon/gnome-settings-session.h 1970-01-01 00:00:00 +0000
432@@ -1,34 +0,0 @@
433-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
434- *
435- * Copyright (C) 2010-2011 Richard Hughes <richard@hughsie.com>
436- *
437- * Licensed under the GNU General Public License Version 2
438- *
439- * This program is free software; you can redistribute it and/or modify
440- * it under the terms of the GNU General Public License as published by
441- * the Free Software Foundation; either version 2 of the License, or
442- * (at your option) any later version.
443- *
444- * This program is distributed in the hope that it will be useful,
445- * but WITHOUT ANY WARRANTY; without even the implied warranty of
446- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
447- * GNU General Public License for more details.
448- *
449- * You should have received a copy of the GNU General Public License
450- * along with this program; if not, write to the Free Software
451- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
452- */
453-
454-#ifndef __GNOME_SETTINGS_SESSION_H
455-#define __GNOME_SETTINGS_SESSION_H
456-
457-#include <glib-object.h>
458-
459-G_BEGIN_DECLS
460-
461-GDBusProxy *gnome_settings_session_get_session_proxy (void);
462-
463-G_END_DECLS
464-
465-#endif /* __GNOME_SETTINGS_SESSION_H */
466-
467
468=== modified file 'gnome-settings-daemon/main.c'
469--- gnome-settings-daemon/main.c 2014-10-07 22:07:40 +0000
470+++ gnome-settings-daemon/main.c 2016-06-29 16:17:06 +0000
471@@ -36,7 +36,7 @@
472 #include "gnome-settings-manager.h"
473 #include "gnome-settings-plugin.h"
474 #include "gnome-settings-profile.h"
475-#include "gnome-settings-session.h"
476+#include "gnome-settings-bus.h"
477 #include "gsd-idle-monitor-private.h"
478
479 #define GNOME_SESSION_DBUS_NAME "org.gnome.SessionManager"
480@@ -351,7 +351,7 @@
481 {
482 GDBusProxy *proxy;
483
484- proxy = gnome_settings_session_get_session_proxy ();
485+ proxy = G_DBUS_PROXY (gnome_settings_bus_get_session_proxy ());
486 #ifdef HAVE_IBUS
487 set_legacy_ibus_env_vars (proxy);
488 #endif
489
490=== added file 'gnome-settings-daemon/org.gnome.ScreenSaver.xml'
491--- gnome-settings-daemon/org.gnome.ScreenSaver.xml 1970-01-01 00:00:00 +0000
492+++ gnome-settings-daemon/org.gnome.ScreenSaver.xml 2016-06-29 16:17:06 +0000
493@@ -0,0 +1,43 @@
494+<!DOCTYPE node PUBLIC
495+ "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
496+ "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
497+
498+<!--
499+ Copyright (C) 2013 Red Hat, Inc.
500+
501+ This library is free software; you can redistribute it and/or
502+ modify it under the terms of the GNU Lesser General Public
503+ License as published by the Free Software Foundation; either
504+ version 2 of the License, or (at your option) any later version.
505+
506+ This library is distributed in the hope that it will be useful,
507+ but WITHOUT ANY WARRANTY; without even the implied warranty of
508+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
509+ Lesser General Public License for more details.
510+
511+ You should have received a copy of the GNU Lesser General
512+ Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
513+-->
514+
515+<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
516+ <!--
517+ org.gnome.ScreenSaver:
518+
519+ An interface used for managing the lock screen.
520+ -->
521+ <interface name="org.gnome.ScreenSaver">
522+ <method name="Lock" />
523+ <method name="GetActive">
524+ <arg name="active" direction="out" type="b" />
525+ </method>
526+ <method name="SetActive">
527+ <arg name="value" direction="in" type="b" />
528+ </method>
529+ <method name="GetActiveTime">
530+ <arg name="value" direction="out" type="u" />
531+ </method>
532+ <signal name="ActiveChanged">
533+ <arg name="new_value" type="b" />
534+ </signal>
535+ </interface>
536+</node>
537
538=== added file 'gnome-settings-daemon/org.gnome.SessionManager.xml'
539--- gnome-settings-daemon/org.gnome.SessionManager.xml 1970-01-01 00:00:00 +0000
540+++ gnome-settings-daemon/org.gnome.SessionManager.xml 2016-06-29 16:17:06 +0000
541@@ -0,0 +1,451 @@
542+<?xml version="1.0" encoding="UTF-8" ?>
543+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
544+<node xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
545+ <interface name="org.gnome.SessionManager">
546+
547+ <!-- Initialization phase interfaces -->
548+
549+ <method name="Setenv">
550+ <arg name="variable" type="s" direction="in">
551+ <doc:doc>
552+ <doc:summary>The variable name</doc:summary>
553+ </doc:doc>
554+ </arg>
555+ <arg name="value" type="s" direction="in">
556+ <doc:doc>
557+ <doc:summary>The value</doc:summary>
558+ </doc:doc>
559+ </arg>
560+ <doc:doc>
561+ <doc:description>
562+ <doc:para>Adds the variable name to the application launch environment with the specified value. May only be used during the Session Manager initialization phase.</doc:para>
563+ </doc:description>
564+ </doc:doc>
565+ </method>
566+
567+ <method name="GetLocale">
568+ <arg name="category" type="i" direction="in">
569+ <doc:doc>
570+ <doc:summary>The locale category</doc:summary>
571+ </doc:doc>
572+ </arg>
573+ <arg name="value" type="s" direction="out">
574+ <doc:doc>
575+ <doc:summary>The value</doc:summary>
576+ </doc:doc>
577+ </arg>
578+ <doc:doc>
579+ <doc:description>
580+ <doc:para>Reads the current state of the specific locale category.</doc:para>
581+ </doc:description>
582+ </doc:doc>
583+ </method>
584+
585+ <method name="InitializationError">
586+ <arg name="message" type="s" direction="in">
587+ <doc:doc>
588+ <doc:summary>The error message</doc:summary>
589+ </doc:doc>
590+ </arg>
591+ <arg name="fatal" type="b" direction="in">
592+ <doc:doc>
593+ <doc:summary>Whether the error should be treated as fatal</doc:summary>
594+ </doc:doc>
595+ </arg>
596+ <doc:doc>
597+ <doc:description>
598+ <doc:para>May be used by applications launched during the Session Manager initialization phase to indicate there was a problem.</doc:para>
599+ </doc:description>
600+ </doc:doc>
601+ </method>
602+
603+ <!-- Running phase interfaces -->
604+
605+ <method name="RegisterClient">
606+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
607+ <arg type="s" name="app_id" direction="in">
608+ <doc:doc>
609+ <doc:summary>The application identifier</doc:summary>
610+ </doc:doc>
611+ </arg>
612+ <arg type="s" name="client_startup_id" direction="in">
613+ <doc:doc>
614+ <doc:summary>Client startup identifier</doc:summary>
615+ </doc:doc>
616+ </arg>
617+ <arg type="o" name="client_id" direction="out">
618+ <doc:doc>
619+ <doc:summary>The object path of the newly registered client</doc:summary>
620+ </doc:doc>
621+ </arg>
622+ <doc:doc>
623+ <doc:description>
624+ <doc:para>Register the caller as a Session Management client.</doc:para>
625+ </doc:description>
626+ </doc:doc>
627+ </method>
628+
629+ <method name="UnregisterClient">
630+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
631+ <arg type="o" name="client_id" direction="in">
632+ <doc:doc>
633+ <doc:summary>The object path of the client</doc:summary>
634+ </doc:doc>
635+ </arg>
636+ <doc:doc>
637+ <doc:description>
638+ <doc:para>Unregister the specified client from Session Management.</doc:para>
639+ </doc:description>
640+ </doc:doc>
641+ </method>
642+
643+ <method name="Inhibit">
644+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
645+ <arg type="s" name="app_id" direction="in">
646+ <doc:doc>
647+ <doc:summary>The application identifier</doc:summary>
648+ </doc:doc>
649+ </arg>
650+ <arg type="u" name="toplevel_xid" direction="in">
651+ <doc:doc>
652+ <doc:summary>The toplevel X window identifier</doc:summary>
653+ </doc:doc>
654+ </arg>
655+ <arg type="s" name="reason" direction="in">
656+ <doc:doc>
657+ <doc:summary>The reason for the inhibit</doc:summary>
658+ </doc:doc>
659+ </arg>
660+ <arg type="u" name="flags" direction="in">
661+ <doc:doc>
662+ <doc:summary>Flags that specify what should be inhibited</doc:summary>
663+ </doc:doc>
664+ </arg>
665+ <arg type="u" name="inhibit_cookie" direction="out">
666+ <doc:doc>
667+ <doc:summary>The cookie</doc:summary>
668+ </doc:doc>
669+ </arg>
670+ <doc:doc>
671+ <doc:summary>
672+ Proactively indicates that the calling application is performing an action that should not be interrupted and sets a reason to be displayed to the user when an interruption is about to take placea.
673+ </doc:summary>
674+ <doc:description>
675+ <doc:para>Applications should invoke this method when they begin an operation that
676+ should not be interrupted, such as creating a CD or DVD. The types of actions
677+ that may be blocked are specified by the flags parameter. When the application
678+ completes the operation it should call <doc:ref type="method" to="org.gnome.SessionManager.Uninhibit">Uninhibit()</doc:ref>
679+ or disconnect from the session bus.
680+ </doc:para>
681+ <doc:para>
682+ Applications should not expect that they will always be able to block the
683+ action. In most cases, users will be given the option to force the action
684+ to take place.
685+ </doc:para>
686+ <doc:para>
687+ Reasons should be short and to the point.
688+ </doc:para>
689+ <doc:para>
690+ The flags parameter must include at least one of the following:
691+ <doc:list>
692+ <doc:item>
693+ <doc:term>1</doc:term>
694+ <doc:definition>Inhibit logging out</doc:definition>
695+ </doc:item>
696+ <doc:item>
697+ <doc:term>2</doc:term>
698+ <doc:definition>Inhibit user switching</doc:definition>
699+ </doc:item>
700+ <doc:item>
701+ <doc:term>4</doc:term>
702+ <doc:definition>Inhibit suspending the session or computer</doc:definition>
703+ </doc:item>
704+ <doc:item>
705+ <doc:term>8</doc:term>
706+ <doc:definition>Inhibit the session being marked as idle</doc:definition>
707+ </doc:item>
708+ <doc:item>
709+ <doc:term>16</doc:term>
710+ <doc:definition>Inhibit auto-mounting removable media for the session</doc:definition>
711+ </doc:item>
712+ </doc:list>
713+ Values for flags may be bitwise or'ed together.
714+ </doc:para>
715+ <doc:para>
716+ The returned cookie is used to uniquely identify this request. It should be used
717+ as an argument to <doc:ref type="method" to="org.gnome.SessionManager.Uninhibit">Uninhibit()</doc:ref> in
718+ order to remove the request.
719+ </doc:para>
720+ </doc:description>
721+ </doc:doc>
722+ </method>
723+
724+ <method name="Uninhibit">
725+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
726+ <arg type="u" name="inhibit_cookie" direction="in">
727+ <doc:doc>
728+ <doc:summary>The cookie</doc:summary>
729+ </doc:doc>
730+ </arg>
731+ <doc:doc>
732+ <doc:description>
733+ <doc:para>Cancel a previous call to <doc:ref type="method" to="org.gnome.SessionManager.Inhibit">Inhibit()</doc:ref> identified by the cookie.</doc:para>
734+ </doc:description>
735+ </doc:doc>
736+ </method>
737+
738+ <method name="IsInhibited">
739+ <arg type="u" name="flags" direction="in">
740+ <doc:doc>
741+ <doc:summary>Flags that spefify what should be inhibited</doc:summary>
742+ </doc:doc>
743+ </arg>
744+ <arg type="b" name="is_inhibited" direction="out">
745+ <doc:doc>
746+ <doc:summary>Returns TRUE if any of the operations in the bitfield flags are inhibited</doc:summary>
747+ </doc:doc>
748+ </arg>
749+ <doc:doc>
750+ <doc:description>
751+ <doc:para>Determine if operation(s) specified by the flags
752+ are currently inhibited. Flags are same as those accepted
753+ by the
754+ <doc:ref type="method" to="org.gnome.SessionManager.Inhibit">Inhibit()</doc:ref>
755+ method.</doc:para>
756+ </doc:description>
757+ </doc:doc>
758+ </method>
759+
760+ <method name="GetClients">
761+ <arg name="clients" direction="out" type="ao">
762+ <doc:doc>
763+ <doc:summary>an array of client IDs</doc:summary>
764+ </doc:doc>
765+ </arg>
766+ <doc:doc>
767+ <doc:description>
768+ <doc:para>This gets a list of all the <doc:ref type="interface" to="org.gnome.SessionManager.Client">Clients</doc:ref>
769+ that are currently known to the session manager.</doc:para>
770+ <doc:para>Each Client ID is an D-Bus object path for the object that implements the
771+ <doc:ref type="interface" to="org.gnome.SessionManager.Client">Client</doc:ref> interface.</doc:para>
772+ </doc:description>
773+ <doc:seealso><doc:ref type="interface" to="org.gnome.SessionManager.Client">org.gnome.SessionManager.Client</doc:ref></doc:seealso>
774+ </doc:doc>
775+ </method>
776+
777+ <method name="GetInhibitors">
778+ <arg name="inhibitors" direction="out" type="ao">
779+ <doc:doc>
780+ <doc:summary>an array of inhibitor IDs</doc:summary>
781+ </doc:doc>
782+ </arg>
783+ <doc:doc>
784+ <doc:description>
785+ <doc:para>This gets a list of all the <doc:ref type="interface" to="org.gnome.SessionManager.Inhibitor">Inhibitors</doc:ref>
786+ that are currently known to the session manager.</doc:para>
787+ <doc:para>Each Inhibitor ID is an D-Bus object path for the object that implements the
788+ <doc:ref type="interface" to="org.gnome.SessionManager.Inhibitor">Inhibitor</doc:ref> interface.</doc:para>
789+ </doc:description>
790+ <doc:seealso><doc:ref type="interface" to="org.gnome.SessionManager.Inhibitor">org.gnome.SessionManager.Inhibitor</doc:ref></doc:seealso>
791+ </doc:doc>
792+ </method>
793+
794+
795+ <method name="IsAutostartConditionHandled">
796+ <arg name="condition" direction="in" type="s">
797+ <doc:doc>
798+ <doc:summary>The autostart condition string</doc:summary>
799+ </doc:doc>
800+ </arg>
801+ <arg name="handled" direction="out" type="b">
802+ <doc:doc>
803+ <doc:summary>True if condition is handled, false otherwise</doc:summary>
804+ </doc:doc>
805+ </arg>
806+ <doc:doc>
807+ <doc:description>
808+ <doc:para>Allows the caller to determine whether the session manager is
809+ handling changes to the specified autostart condition.</doc:para>
810+ </doc:description>
811+ </doc:doc>
812+ </method>
813+
814+ <method name="Shutdown">
815+ <doc:doc>
816+ <doc:description>
817+ <doc:para>Request a shutdown dialog.</doc:para>
818+ </doc:description>
819+ </doc:doc>
820+ </method>
821+
822+ <method name="Reboot">
823+ <doc:doc>
824+ <doc:description>
825+ <doc:para>Request a reboot dialog.</doc:para>
826+ </doc:description>
827+ </doc:doc>
828+ </method>
829+
830+ <method name="CanShutdown">
831+ <arg name="is_available" direction="out" type="b">
832+ <doc:doc>
833+ <doc:summary>True if shutdown is available to the user, false otherwise</doc:summary>
834+ </doc:doc>
835+ </arg>
836+ <doc:doc>
837+ <doc:description>
838+ <doc:para>Allows the caller to determine whether or not it's okay to show
839+ a shutdown option in the UI</doc:para>
840+ </doc:description>
841+ </doc:doc>
842+ </method>
843+
844+ <method name="Logout">
845+ <arg name="mode" type="u" direction="in">
846+ <doc:doc>
847+ <doc:summary>The type of logout that is being requested</doc:summary>
848+ </doc:doc>
849+ </arg>
850+ <doc:doc>
851+ <doc:description>
852+ <doc:para>Request a logout dialog</doc:para>
853+ <doc:para>
854+ Allowed values for the mode parameter are:
855+ <doc:list>
856+ <doc:item>
857+ <doc:term>0</doc:term>
858+ <doc:definition>Normal.</doc:definition>
859+ </doc:item>
860+ <doc:item>
861+ <doc:term>1</doc:term>
862+ <doc:definition>No confirmation inferface should be shown.</doc:definition>
863+ </doc:item>
864+ <doc:item>
865+ <doc:term>2</doc:term>
866+ <doc:definition>Forcefully logout. No confirmation will be shown and any inhibitors will be ignored.</doc:definition>
867+ </doc:item>
868+ </doc:list>
869+ Values for flags may be bitwise or'ed together.
870+ </doc:para>
871+ </doc:description>
872+ </doc:doc>
873+ </method>
874+
875+ <method name="IsSessionRunning">
876+ <arg name="running" direction="out" type="b">
877+ <doc:doc>
878+ <doc:summary>True if the session has entered the Running phase, false otherwise</doc:summary>
879+ </doc:doc>
880+ </arg>
881+ <doc:doc>
882+ <doc:description>
883+ <doc:para>Allows the caller to determine whether the session manager
884+ has entered the Running phase, in case the client missed the
885+ SessionRunning signal.</doc:para>
886+ </doc:description>
887+ </doc:doc>
888+ </method>
889+
890+ <!-- Signals -->
891+
892+ <signal name="ClientAdded">
893+ <arg name="id" type="o">
894+ <doc:doc>
895+ <doc:summary>The object path for the added client</doc:summary>
896+ </doc:doc>
897+ </arg>
898+ <doc:doc>
899+ <doc:description>
900+ <doc:para>Emitted when a client has been added to the session manager.
901+ </doc:para>
902+ </doc:description>
903+ </doc:doc>
904+ </signal>
905+ <signal name="ClientRemoved">
906+ <arg name="id" type="o">
907+ <doc:doc>
908+ <doc:summary>The object path for the removed client</doc:summary>
909+ </doc:doc>
910+ </arg>
911+ <doc:doc>
912+ <doc:description>
913+ <doc:para>Emitted when a client has been removed from the session manager.
914+ </doc:para>
915+ </doc:description>
916+ </doc:doc>
917+ </signal>
918+
919+ <signal name="InhibitorAdded">
920+ <arg name="id" type="o">
921+ <doc:doc>
922+ <doc:summary>The object path for the added inhibitor</doc:summary>
923+ </doc:doc>
924+ </arg>
925+ <doc:doc>
926+ <doc:description>
927+ <doc:para>Emitted when an inhibitor has been added to the session manager.
928+ </doc:para>
929+ </doc:description>
930+ </doc:doc>
931+ </signal>
932+ <signal name="InhibitorRemoved">
933+ <arg name="id" type="o">
934+ <doc:doc>
935+ <doc:summary>The object path for the removed inhibitor</doc:summary>
936+ </doc:doc>
937+ </arg>
938+ <doc:doc>
939+ <doc:description>
940+ <doc:para>Emitted when an inhibitor has been removed from the session manager.
941+ </doc:para>
942+ </doc:description>
943+ </doc:doc>
944+ </signal>
945+
946+ <signal name="SessionRunning">
947+ <doc:doc>
948+ <doc:description>
949+ <doc:para>Indicates the session has entered the Running phase.</doc:para>
950+ </doc:description>
951+ </doc:doc>
952+ </signal>
953+
954+ <signal name="SessionOver">
955+ <doc:doc>
956+ <doc:description>
957+ <doc:para>Indicates the session is about to end.</doc:para>
958+ </doc:description>
959+ </doc:doc>
960+ </signal>
961+
962+ <!-- Properties -->
963+
964+ <property name="SessionName" type="s" access="read">
965+ <doc:doc>
966+ <doc:description>
967+ <doc:para>The name of the session that has been loaded.</doc:para>
968+ </doc:description>
969+ </doc:doc>
970+ </property>
971+
972+ <property name="SessionIsActive" type="b" access="read">
973+ <doc:doc>
974+ <doc:description>
975+ <doc:para>If true, the session is currently in the
976+ foreground and available for user input.</doc:para>
977+ </doc:description>
978+ </doc:doc>
979+ </property>
980+
981+ <property name="InhibitedActions" type="u" access="read">
982+ <doc:doc>
983+ <doc:description>
984+ <doc:para>A bitmask of flags to indicate which actions
985+ are inhibited. See the Inhibit() function's description
986+ for a list of possible values.</doc:para>
987+ </doc:description>
988+ </doc:doc>
989+ </property>
990+
991+ </interface>
992+</node>
993
994=== modified file 'plugins/automount/gsd-automount-manager.c'
995--- plugins/automount/gsd-automount-manager.c 2015-06-30 15:15:52 +0000
996+++ plugins/automount/gsd-automount-manager.c 2016-06-29 16:17:06 +0000
997@@ -29,7 +29,7 @@
998 #include <gio/gio.h>
999
1000 #include "gnome-settings-profile.h"
1001-#include "gnome-settings-session.h"
1002+#include "gnome-settings-bus.h"
1003 #include "gsd-automount-manager.h"
1004 #include "gsd-autorun.h"
1005
1006@@ -356,7 +356,7 @@
1007 static void
1008 do_initialize_session (GsdAutomountManager *manager)
1009 {
1010- manager->priv->session = gnome_settings_session_get_session_proxy ();
1011+ manager->priv->session = G_DBUS_PROXY (gnome_settings_bus_get_session_proxy ());
1012 g_signal_connect (manager->priv->session, "g-properties-changed",
1013 G_CALLBACK (session_state_changed),
1014 manager);
1015@@ -364,8 +364,6 @@
1016 }
1017
1018 #define SCREENSAVER_NAME "org.gnome.ScreenSaver"
1019-#define SCREENSAVER_PATH "/org/gnome/ScreenSaver"
1020-#define SCREENSAVER_INTERFACE "org.gnome.ScreenSaver"
1021
1022 static void
1023 screensaver_signal_callback (GDBusProxy *proxy,
1024@@ -413,32 +411,27 @@
1025 }
1026
1027 static void
1028-screensaver_proxy_ready_cb (GObject *source,
1029- GAsyncResult *res,
1030- gpointer user_data)
1031+screensaver_appeared_callback (GDBusConnection *connection,
1032+ const gchar *name,
1033+ const gchar *name_owner,
1034+ gpointer user_data)
1035 {
1036 GsdAutomountManager *manager = user_data;
1037- GError *error = NULL;
1038- GDBusProxy *ss_proxy;
1039-
1040- ss_proxy = g_dbus_proxy_new_finish (res, &error);
1041-
1042- if (error != NULL) {
1043- g_warning ("Can't get proxy for the ScreenSaver object: %s",
1044- error->message);
1045- g_error_free (error);
1046-
1047+
1048+ g_debug ("ScreenSaver name appeared");
1049+
1050+ manager->priv->ss_proxy = G_DBUS_PROXY (gnome_settings_bus_get_screen_saver_proxy ());
1051+
1052+ if (manager->priv->ss_proxy == NULL) {
1053+ g_warning ("Can't get proxy for the ScreenSaver object");
1054 return;
1055 }
1056
1057 g_debug ("ScreenSaver proxy ready");
1058-
1059- manager->priv->ss_proxy = ss_proxy;
1060-
1061- g_signal_connect (ss_proxy, "g-signal",
1062+ g_signal_connect (manager->priv->ss_proxy, "g-signal",
1063 G_CALLBACK (screensaver_signal_callback), manager);
1064
1065- g_dbus_proxy_call (ss_proxy,
1066+ g_dbus_proxy_call (manager->priv->ss_proxy,
1067 "GetActive",
1068 NULL,
1069 G_DBUS_CALL_FLAGS_NO_AUTO_START,
1070@@ -449,29 +442,6 @@
1071 }
1072
1073 static void
1074-screensaver_appeared_callback (GDBusConnection *connection,
1075- const gchar *name,
1076- const gchar *name_owner,
1077- gpointer user_data)
1078-{
1079- GsdAutomountManager *manager = user_data;
1080-
1081- g_debug ("ScreenSaver name appeared");
1082-
1083- manager->priv->screensaver_active = FALSE;
1084-
1085- g_dbus_proxy_new (connection,
1086- G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
1087- NULL,
1088- name,
1089- SCREENSAVER_PATH,
1090- SCREENSAVER_INTERFACE,
1091- NULL,
1092- screensaver_proxy_ready_cb,
1093- manager);
1094-}
1095-
1096-static void
1097 screensaver_vanished_callback (GDBusConnection *connection,
1098 const gchar *name,
1099 gpointer user_data)
1100@@ -695,6 +665,10 @@
1101
1102 g_debug ("Stopping automounting manager");
1103
1104+ if (p->ss_proxy) {
1105+ g_signal_handlers_disconnect_by_data (p->ss_proxy, manager);
1106+ }
1107+
1108 g_clear_object (&p->session);
1109 g_clear_object (&p->volume_monitor);
1110 g_clear_object (&p->settings);
1111
1112=== modified file 'plugins/background/gsd-background-manager.c'
1113--- plugins/background/gsd-background-manager.c 2013-11-13 01:43:03 +0000
1114+++ plugins/background/gsd-background-manager.c 2016-06-29 16:17:06 +0000
1115@@ -42,7 +42,7 @@
1116 #include <libgnome-desktop/gnome-bg.h>
1117 #include <X11/Xatom.h>
1118
1119-#include "gnome-settings-session.h"
1120+#include "gnome-settings-bus.h"
1121 #include "gnome-settings-profile.h"
1122 #include "gsd-background-manager.h"
1123
1124@@ -335,7 +335,7 @@
1125 draw_background_after_session_loads (GsdBackgroundManager *manager)
1126 {
1127 manager->priv->proxy =
1128- gnome_settings_session_get_session_proxy ();
1129+ G_DBUS_PROXY (gnome_settings_bus_get_session_proxy ());
1130
1131 manager->priv->proxy_signal_id = g_signal_connect (manager->priv->proxy,
1132 "g-signal",
1133
1134=== modified file 'plugins/color/gsd-color-manager.c'
1135--- plugins/color/gsd-color-manager.c 2014-06-26 00:02:19 +0000
1136+++ plugins/color/gsd-color-manager.c 2016-06-29 16:17:06 +0000
1137@@ -31,7 +31,7 @@
1138
1139 #include "gnome-settings-plugin.h"
1140 #include "gnome-settings-profile.h"
1141-#include "gnome-settings-session.h"
1142+#include "gnome-settings-bus.h"
1143 #include "gsd-color-manager.h"
1144 #include "gcm-profile-store.h"
1145 #include "gcm-dmi.h"
1146@@ -46,7 +46,7 @@
1147
1148 struct GsdColorManagerPrivate
1149 {
1150- GDBusProxy *session;
1151+ GsdSessionManager *session;
1152 CdClient *client;
1153 GSettings *settings;
1154 GcmProfileStore *profile_store;
1155@@ -2142,7 +2142,7 @@
1156 priv = manager->priv = GSD_COLOR_MANAGER_GET_PRIVATE (manager);
1157
1158 /* track the active session */
1159- priv->session = gnome_settings_session_get_session_proxy ();
1160+ priv->session = gnome_settings_bus_get_session_proxy ();
1161 g_signal_connect (priv->session, "g-properties-changed",
1162 G_CALLBACK (gcm_session_active_changed_cb), manager);
1163
1164@@ -2196,6 +2196,8 @@
1165
1166 manager = GSD_COLOR_MANAGER (object);
1167
1168+ g_signal_handlers_disconnect_by_data (manager->priv->session, manager);
1169+
1170 g_clear_object (&manager->priv->settings);
1171 g_clear_object (&manager->priv->client);
1172 g_clear_object (&manager->priv->profile_store);
1173
1174=== modified file 'plugins/common/gsd-input-helper.c'
1175--- plugins/common/gsd-input-helper.c 2015-10-07 16:32:40 +0000
1176+++ plugins/common/gsd-input-helper.c 2016-06-29 16:17:06 +0000
1177@@ -595,7 +595,10 @@
1178 guint *value, w, h;
1179 int i, n_info;
1180
1181+ /* ignore errors, device might be removed before config is done as in #1503758 */
1182+ gdk_error_trap_push();
1183 info = XIQueryDevice (GDK_DISPLAY_XDISPLAY (display), deviceid, &n_info);
1184+ gdk_error_trap_pop_ignored ();
1185 *width = *height = w = h = 0;
1186
1187 if (!info)
1188
1189=== modified file 'plugins/keyboard/gsd-keyboard-manager.c'
1190--- plugins/keyboard/gsd-keyboard-manager.c 2016-01-21 10:58:12 +0000
1191+++ plugins/keyboard/gsd-keyboard-manager.c 2016-06-29 16:17:06 +0000
1192@@ -55,7 +55,7 @@
1193
1194 #include <act/act.h>
1195
1196-#include "gnome-settings-session.h"
1197+#include "gnome-settings-bus.h"
1198 #include "gnome-settings-profile.h"
1199 #include "gsd-keyboard-manager.h"
1200 #include "gsd-input-helper.h"
1201
1202=== modified file 'plugins/media-keys/gsd-media-keys-manager.c'
1203--- plugins/media-keys/gsd-media-keys-manager.c 2015-12-01 15:39:26 +0000
1204+++ plugins/media-keys/gsd-media-keys-manager.c 2016-06-29 16:17:06 +0000
1205@@ -48,7 +48,7 @@
1206 #endif
1207
1208 #include "gnome-settings-plugin.h"
1209-#include "gnome-settings-session.h"
1210+#include "gnome-settings-bus.h"
1211 #include "gnome-settings-profile.h"
1212 #include "gsd-marshal.h"
1213 #include "gsd-media-keys-manager.h"
1214@@ -80,10 +80,6 @@
1215 #define GNOME_KEYRING_DBUS_PATH "/org/gnome/keyring/daemon"
1216 #define GNOME_KEYRING_DBUS_INTERFACE "org.gnome.keyring.Daemon"
1217
1218-#define GS_DBUS_NAME "org.gnome.ScreenSaver"
1219-#define GS_DBUS_PATH "/org/gnome/ScreenSaver"
1220-#define GS_DBUS_INTERFACE "org.gnome.ScreenSaver"
1221-
1222 #define SHELL_DBUS_NAME "org.gnome.Shell"
1223 #define SHELL_DBUS_PATH "/org/gnome/Shell"
1224
1225@@ -203,6 +199,9 @@
1226 GCancellable *shell_cancellable;
1227 GCancellable *grab_cancellable;
1228
1229+ /* ScreenSaver stuff */
1230+ GsdScreenSaver *screen_saver_proxy;
1231+
1232 /* systemd stuff */
1233 GDBusProxy *logind_proxy;
1234 gint inhibit_keys_fd;
1235@@ -1160,7 +1159,7 @@
1236 GVariant *variant;
1237 GDBusProxy *proxy;
1238
1239- proxy = gnome_settings_session_get_session_proxy ();
1240+ proxy = G_DBUS_PROXY (gnome_settings_bus_get_session_proxy ());
1241 variant = g_dbus_proxy_call_sync (proxy,
1242 "Shutdown",
1243 NULL,
1244@@ -1339,22 +1338,34 @@
1245 }
1246
1247 static void
1248+on_screen_locked (GsdScreenSaver *screen_saver,
1249+ GAsyncResult *result,
1250+ GsdMediaKeysManager *manager)
1251+{
1252+ gboolean is_locked;
1253+ GError *error = NULL;
1254+
1255+ is_locked = gsd_screen_saver_call_lock_finish (screen_saver, result, &error);
1256+
1257+ if (!is_locked) {
1258+ g_warning ("Couldn't lock screen: %s", error->message);
1259+ g_error_free (error);
1260+ return;
1261+ }
1262+}
1263+
1264+static void
1265 do_lock_screensaver (GsdMediaKeysManager *manager)
1266 {
1267 GsdMediaKeysManagerPrivate *priv = manager->priv;
1268
1269- if (priv->connection == NULL) {
1270- g_warning ("No existing D-Bus connection trying to handle screensaver lock key");
1271- return;
1272- }
1273- g_dbus_connection_call (manager->priv->connection,
1274- GS_DBUS_NAME,
1275- GS_DBUS_PATH,
1276- GS_DBUS_INTERFACE,
1277- "Lock",
1278- NULL, NULL,
1279- G_DBUS_CALL_FLAGS_NONE, -1,
1280- NULL, NULL, NULL);
1281+ if (priv->screen_saver_proxy == NULL)
1282+ priv->screen_saver_proxy = gnome_settings_bus_get_screen_saver_proxy ();
1283+
1284+ gsd_screen_saver_call_lock (priv->screen_saver_proxy,
1285+ priv->cancellable,
1286+ (GAsyncReadyCallback) on_screen_locked,
1287+ manager);
1288 }
1289
1290 static void
1291@@ -3415,6 +3426,8 @@
1292 if (media_keys_manager->priv->inhibit_keys_fd != -1)
1293 close (media_keys_manager->priv->inhibit_keys_fd);
1294
1295+ g_clear_object (&media_keys_manager->priv->screen_saver_proxy);
1296+
1297 G_OBJECT_CLASS (gsd_media_keys_manager_parent_class)->finalize (object);
1298 }
1299
1300
1301=== modified file 'plugins/power/gsd-power-manager.c'
1302--- plugins/power/gsd-power-manager.c 2016-06-29 15:38:15 +0000
1303+++ plugins/power/gsd-power-manager.c 2016-06-29 16:17:06 +0000
1304@@ -43,7 +43,7 @@
1305 #include "gpm-common.h"
1306 #include "gnome-settings-plugin.h"
1307 #include "gnome-settings-profile.h"
1308-#include "gnome-settings-session.h"
1309+#include "gnome-settings-bus.h"
1310 #include "gsd-enums.h"
1311 #include "gsd-power-manager.h"
1312 #include "gsd-rr.h"
1313@@ -68,10 +68,6 @@
1314 #define GSD_POWER_DBUS_INTERFACE_SCREEN GSD_POWER_DBUS_INTERFACE ".Screen"
1315 #define GSD_POWER_DBUS_INTERFACE_KEYBOARD GSD_POWER_DBUS_INTERFACE ".Keyboard"
1316
1317-#define GS_DBUS_NAME "org.gnome.ScreenSaver"
1318-#define GS_DBUS_PATH "/org/gnome/ScreenSaver"
1319-#define GS_DBUS_INTERFACE "org.gnome.ScreenSaver"
1320-
1321 #define GSD_POWER_MANAGER_NOTIFY_TIMEOUT_SHORT 10 * 1000 /* ms */
1322 #define GSD_POWER_MANAGER_NOTIFY_TIMEOUT_LONG 30 * 1000 /* ms */
1323
1324@@ -144,7 +140,7 @@
1325 struct GsdPowerManagerPrivate
1326 {
1327 /* D-Bus */
1328- GDBusProxy *session;
1329+ GsdSessionManager *session;
1330 guint name_id;
1331 GDBusNodeInfo *introspection_data;
1332 GDBusConnection *connection;
1333@@ -153,7 +149,7 @@
1334
1335 /* Settings */
1336 GSettings *settings;
1337- GSettings *settings_session;
1338+ GSettings *settings_bus;
1339 GSettings *settings_screensaver;
1340 GSettings *settings_xrandr;
1341
1342@@ -166,9 +162,7 @@
1343 guint low_time;
1344
1345 /* Screensaver */
1346- guint screensaver_watch_id;
1347- GCancellable *screensaver_cancellable;
1348- GDBusProxy *screensaver_proxy;
1349+ GsdScreenSaver *screensaver_proxy;
1350 gboolean screensaver_active;
1351
1352 /* State */
1353@@ -192,7 +186,6 @@
1354
1355 /* Keyboard */
1356 GDBusProxy *upower_kdb_proxy;
1357- gint kbd_brightness_now;
1358 gint kbd_brightness_max;
1359 gint kbd_brightness_old;
1360 gint kbd_brightness_pre_dim;
1361@@ -912,8 +905,6 @@
1362 guint i;
1363 GPtrArray *array = NULL;
1364 UpDevice *device;
1365- gboolean ret;
1366- GError *error = NULL;
1367
1368 engine_recalculate_state (manager);
1369
1370@@ -1739,7 +1730,7 @@
1371 static void
1372 gnome_session_shutdown (GsdPowerManager *manager)
1373 {
1374- g_dbus_proxy_call (manager->priv->session,
1375+ g_dbus_proxy_call (G_DBUS_PROXY (manager->priv->session),
1376 "Shutdown",
1377 NULL,
1378 G_DBUS_CALL_FLAGS_NONE,
1379@@ -1771,7 +1762,7 @@
1380 gnome_session_logout (GsdPowerManager *manager,
1381 guint logout_mode)
1382 {
1383- g_dbus_proxy_call (manager->priv->session,
1384+ g_dbus_proxy_call (G_DBUS_PROXY (manager->priv->session),
1385 "Logout",
1386 g_variant_new ("(u)", logout_mode),
1387 G_DBUS_CALL_FLAGS_NONE,
1388@@ -1931,14 +1922,41 @@
1389 }
1390
1391 static gboolean
1392+upower_kbd_get_brightness (GsdPowerManager *manager)
1393+{
1394+ GVariant *k_now = NULL;
1395+ GError *error = NULL;
1396+ gint now;
1397+
1398+ k_now = g_dbus_proxy_call_sync (manager->priv->upower_kdb_proxy,
1399+ "GetBrightness",
1400+ NULL,
1401+ G_DBUS_CALL_FLAGS_NONE,
1402+ -1,
1403+ NULL,
1404+ &error);
1405+ if (k_now == NULL) {
1406+ if (error->domain != G_DBUS_ERROR ||
1407+ error->code != G_DBUS_ERROR_UNKNOWN_METHOD) {
1408+ g_warning ("Failed to get brightness: %s",
1409+ error->message);
1410+ }
1411+
1412+ g_error_free (error);
1413+ return -1;
1414+ }
1415+
1416+ g_variant_get (k_now, "(i)", &now);
1417+ g_variant_unref (k_now);
1418+
1419+ return now;
1420+}
1421+
1422+static gboolean
1423 upower_kbd_set_brightness (GsdPowerManager *manager, guint value, GError **error)
1424 {
1425 GVariant *retval;
1426
1427- /* same as before */
1428- if (manager->priv->kbd_brightness_now == value)
1429- return TRUE;
1430-
1431 /* update h/w value */
1432 retval = g_dbus_proxy_call_sync (manager->priv->upower_kdb_proxy,
1433 "SetBrightness",
1434@@ -1950,17 +1968,16 @@
1435 if (retval == NULL)
1436 return FALSE;
1437
1438- /* save new value */
1439- manager->priv->kbd_brightness_now = value;
1440 g_variant_unref (retval);
1441 return TRUE;
1442 }
1443
1444-static gboolean
1445+static int
1446 upower_kbd_toggle (GsdPowerManager *manager,
1447 GError **error)
1448 {
1449 gboolean ret;
1450+ int value = -1;
1451
1452 if (manager->priv->kbd_brightness_old >= 0) {
1453 g_debug ("keyboard toggle off");
1454@@ -1970,19 +1987,24 @@
1455 if (ret) {
1456 /* succeeded, set to -1 since now no old value */
1457 manager->priv->kbd_brightness_old = -1;
1458+ value = 0;
1459 }
1460 } else {
1461 g_debug ("keyboard toggle on");
1462 /* save the current value to restore later when untoggling */
1463- manager->priv->kbd_brightness_old = manager->priv->kbd_brightness_now;
1464+ manager->priv->kbd_brightness_old = upower_kbd_get_brightness (manager);
1465 ret = upower_kbd_set_brightness (manager, 0, error);
1466 if (!ret) {
1467 /* failed, reset back to -1 */
1468 manager->priv->kbd_brightness_old = -1;
1469+ } else {
1470+ value = 0;
1471 }
1472 }
1473
1474- return ret;
1475+ if (ret)
1476+ return value;
1477+ return -1;
1478 }
1479
1480 static gboolean
1481@@ -2057,7 +2079,7 @@
1482 }
1483
1484 if (policy == GSD_POWER_ACTION_NOTHING) {
1485- inhibit_lid_switch (manager);
1486+ inhibit_lid_switch (manager);
1487 manager->priv->inhibit_lid_switch_action = TRUE;
1488 } else {
1489 uninhibit_lid_switch (manager);
1490@@ -2088,7 +2110,7 @@
1491 do_lock = g_settings_get_boolean (manager->priv->settings_screensaver,
1492 "lock-enabled");
1493 if (!do_lock) {
1494- g_dbus_proxy_call_sync (manager->priv->screensaver_proxy,
1495+ g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->screensaver_proxy),
1496 "SetActive",
1497 g_variant_new ("(b)", TRUE),
1498 G_DBUS_CALL_FLAGS_NONE,
1499@@ -2096,7 +2118,7 @@
1500 return;
1501 }
1502
1503- g_dbus_proxy_call_sync (manager->priv->screensaver_proxy,
1504+ g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->screensaver_proxy),
1505 "Lock",
1506 NULL,
1507 G_DBUS_CALL_FLAGS_NONE,
1508@@ -2275,7 +2297,7 @@
1509 if (manager->priv->upower_kdb_proxy == NULL)
1510 return TRUE;
1511
1512- now = manager->priv->kbd_brightness_now;
1513+ now = upower_kbd_get_brightness (manager);
1514 max = manager->priv->kbd_brightness_max;
1515 idle = PERCENTAGE_TO_ABS (0, max, idle_percentage);
1516 if (idle > now) {
1517@@ -2299,7 +2321,7 @@
1518 GVariant *variant;
1519 gboolean is_session_active = FALSE;
1520
1521- variant = g_dbus_proxy_get_cached_property (manager->priv->session,
1522+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (manager->priv->session),
1523 "SessionIsActive");
1524 if (variant) {
1525 is_session_active = g_variant_get_boolean (variant);
1526@@ -2384,8 +2406,7 @@
1527 /* only toggle keyboard if present and not already toggled */
1528 if (manager->priv->upower_kdb_proxy &&
1529 manager->priv->kbd_brightness_old == -1) {
1530- ret = upower_kbd_toggle (manager, &error);
1531- if (!ret) {
1532+ if (upower_kbd_toggle (manager, &error) < 0) {
1533 g_warning ("failed to turn the kbd backlight off: %s",
1534 error->message);
1535 g_error_free (error);
1536@@ -2427,8 +2448,7 @@
1537 /* only toggle keyboard if present and already toggled off */
1538 if (manager->priv->upower_kdb_proxy &&
1539 manager->priv->kbd_brightness_old != -1) {
1540- ret = upower_kbd_toggle (manager, &error);
1541- if (!ret) {
1542+ if (upower_kbd_toggle (manager, &error) < 0) {
1543 g_warning ("failed to turn the kbd backlight on: %s",
1544 error->message);
1545 g_clear_error (&error);
1546@@ -2464,7 +2484,7 @@
1547 if (manager->priv->session == NULL)
1548 return FALSE;
1549
1550- variant = g_dbus_proxy_get_cached_property (manager->priv->session,
1551+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (manager->priv->session),
1552 "InhibitedActions");
1553 if (!variant)
1554 return FALSE;
1555@@ -2598,7 +2618,7 @@
1556 timeout_dim = SCREENSAVER_TIMEOUT_BLANK;
1557 } else {
1558 if (g_settings_get_boolean (manager->priv->settings, "idle-dim")) {
1559- timeout_dim = g_settings_get_uint (manager->priv->settings_session,
1560+ timeout_dim = g_settings_get_uint (manager->priv->settings_bus,
1561 "idle-delay");
1562 if (timeout_dim == 0) {
1563 timeout_dim = IDLE_DIM_BLANK_DISABLED_MIN;
1564@@ -2765,88 +2785,10 @@
1565 }
1566
1567 static void
1568-get_active_cb (GDBusProxy *proxy,
1569- GAsyncResult *result,
1570- GsdPowerManager *manager)
1571-{
1572- GVariant *res;
1573- GError *error = NULL;
1574-
1575- res = g_dbus_proxy_call_finish (proxy, result, &error);
1576- if (!res) {
1577- g_warning ("Failed to run GetActive() function on screensaver: %s", error->message);
1578- g_error_free (error);
1579- return;
1580- }
1581-
1582- handle_screensaver_active (manager, res);
1583- g_variant_unref (res);
1584-}
1585-
1586-static void
1587-screensaver_proxy_ready_cb (GObject *source_object,
1588- GAsyncResult *res,
1589- GsdPowerManager *manager)
1590-{
1591- GError *error = NULL;
1592- GDBusProxy *proxy;
1593-
1594- proxy = g_dbus_proxy_new_finish (res, &error);
1595-
1596- if (proxy == NULL) {
1597- if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
1598- g_warning ("Could not connect to screensaver: %s", error->message);
1599- g_error_free (error);
1600- return;
1601- }
1602-
1603- manager->priv->screensaver_proxy = proxy;
1604-
1605- g_signal_connect (manager->priv->screensaver_proxy, "g-signal",
1606- G_CALLBACK (screensaver_signal_cb), manager);
1607- g_dbus_proxy_call (manager->priv->screensaver_proxy,
1608- "GetActive",
1609- NULL,
1610- 0,
1611- G_MAXINT,
1612- NULL,
1613- (GAsyncReadyCallback)get_active_cb,
1614- manager);
1615-
1616-}
1617-
1618-static void
1619-screensaver_appeared_cb (GDBusConnection *connection,
1620- const char *name,
1621- const char *name_owner,
1622- GsdPowerManager *manager)
1623-{
1624- g_dbus_proxy_new (connection,
1625- 0,
1626- NULL,
1627- GS_DBUS_NAME,
1628- GS_DBUS_PATH,
1629- GS_DBUS_INTERFACE,
1630- manager->priv->screensaver_cancellable,
1631- (GAsyncReadyCallback) screensaver_proxy_ready_cb,
1632- manager);
1633-
1634-}
1635-
1636-static void
1637-screensaver_vanished_cb (GDBusConnection *connection,
1638- const char *name,
1639- GsdPowerManager *manager)
1640-{
1641- g_clear_object (&manager->priv->screensaver_proxy);
1642-}
1643-
1644-static void
1645 power_keyboard_proxy_ready_cb (GObject *source_object,
1646 GAsyncResult *res,
1647 gpointer user_data)
1648 {
1649- GVariant *k_now = NULL;
1650 GVariant *k_max = NULL;
1651 GError *error = NULL;
1652 GsdPowerManager *manager = GSD_POWER_MANAGER (user_data);
1653@@ -2859,23 +2801,6 @@
1654 goto out;
1655 }
1656
1657- k_now = g_dbus_proxy_call_sync (manager->priv->upower_kdb_proxy,
1658- "GetBrightness",
1659- NULL,
1660- G_DBUS_CALL_FLAGS_NONE,
1661- -1,
1662- NULL,
1663- &error);
1664- if (k_now == NULL) {
1665- if (error->domain != G_DBUS_ERROR ||
1666- error->code != G_DBUS_ERROR_UNKNOWN_METHOD) {
1667- g_warning ("Failed to get brightness: %s",
1668- error->message);
1669- }
1670- g_error_free (error);
1671- goto out;
1672- }
1673-
1674 k_max = g_dbus_proxy_call_sync (manager->priv->upower_kdb_proxy,
1675 "GetMaxBrightness",
1676 NULL,
1677@@ -2884,17 +2809,20 @@
1678 NULL,
1679 &error);
1680 if (k_max == NULL) {
1681- g_warning ("Failed to get max brightness: %s", error->message);
1682+ if (error->domain != G_DBUS_ERROR ||
1683+ error->code != G_DBUS_ERROR_UNKNOWN_METHOD) {
1684+ g_warning ("Failed to get max brightness: %s",
1685+ error->message);
1686+ }
1687 g_error_free (error);
1688 goto out;
1689 }
1690
1691- g_variant_get (k_now, "(i)", &manager->priv->kbd_brightness_now);
1692 g_variant_get (k_max, "(i)", &manager->priv->kbd_brightness_max);
1693
1694 /* set brightness to max if not currently set so is something
1695 * sensible */
1696- if (manager->priv->kbd_brightness_now < 0) {
1697+ if (upower_kbd_get_brightness (manager) < 0) {
1698 gboolean ret;
1699 ret = upower_kbd_set_brightness (manager,
1700 manager->priv->kbd_brightness_max,
1701@@ -2907,8 +2835,6 @@
1702 }
1703 }
1704 out:
1705- if (k_now != NULL)
1706- g_variant_unref (k_now);
1707 if (k_max != NULL)
1708 g_variant_unref (k_max);
1709 }
1710@@ -3304,11 +3230,16 @@
1711 inhibit_suspend (manager);
1712
1713 /* track the active session */
1714- manager->priv->session = gnome_settings_session_get_session_proxy ();
1715+ manager->priv->session = gnome_settings_bus_get_session_proxy ();
1716 g_signal_connect (manager->priv->session, "g-properties-changed",
1717 G_CALLBACK (engine_session_properties_changed_cb),
1718 manager);
1719
1720+ manager->priv->screensaver_proxy = gnome_settings_bus_get_screen_saver_proxy ();
1721+
1722+ g_signal_connect (manager->priv->screensaver_proxy, "g-signal",
1723+ G_CALLBACK (screensaver_signal_cb), manager);
1724+
1725 manager->priv->kbd_brightness_old = -1;
1726 manager->priv->kbd_brightness_pre_dim = -1;
1727 manager->priv->pre_dim_brightness = -1;
1728@@ -3316,8 +3247,8 @@
1729 g_signal_connect (manager->priv->settings, "changed",
1730 G_CALLBACK (engine_settings_key_changed_cb), manager);
1731 manager->priv->settings_screensaver = g_settings_new ("org.gnome.desktop.screensaver");
1732- manager->priv->settings_session = g_settings_new ("org.gnome.desktop.session");
1733- g_signal_connect (manager->priv->settings_session, "changed",
1734+ manager->priv->settings_bus = g_settings_new ("org.gnome.desktop.session");
1735+ g_signal_connect (manager->priv->settings_bus, "changed",
1736 G_CALLBACK (engine_settings_key_changed_cb), manager);
1737 manager->priv->settings_xrandr = g_settings_new (GSD_XRANDR_SETTINGS_SCHEMA);
1738 manager->priv->up_client = up_client_new ();
1739@@ -3355,15 +3286,6 @@
1740 session_presence_proxy_ready_cb,
1741 manager);
1742
1743- manager->priv->screensaver_watch_id =
1744- g_bus_watch_name (G_BUS_TYPE_SESSION,
1745- GS_DBUS_NAME,
1746- G_BUS_NAME_WATCHER_FLAGS_NONE,
1747- (GBusNameAppearedCallback) screensaver_appeared_cb,
1748- (GBusNameVanishedCallback) screensaver_vanished_cb,
1749- manager,
1750- NULL);
1751-
1752 manager->priv->devices_array = g_ptr_array_new_with_free_func (g_object_unref);
1753
1754 /* create a fake virtual composite battery */
1755@@ -3440,16 +3362,6 @@
1756 manager->priv->inhibit_lid_switch_timer_id = 0;
1757 }
1758
1759- if (manager->priv->screensaver_cancellable != NULL) {
1760- g_cancellable_cancel (manager->priv->screensaver_cancellable);
1761- g_clear_object (&manager->priv->screensaver_cancellable);
1762- }
1763-
1764- if (manager->priv->screensaver_watch_id != 0) {
1765- g_bus_unwatch_name (manager->priv->screensaver_watch_id);
1766- manager->priv->screensaver_watch_id = 0;
1767- }
1768-
1769 if (manager->priv->bus_cancellable != NULL) {
1770 g_cancellable_cancel (manager->priv->bus_cancellable);
1771 g_object_unref (manager->priv->bus_cancellable);
1772@@ -3466,7 +3378,7 @@
1773 g_clear_object (&manager->priv->session);
1774 g_clear_object (&manager->priv->settings);
1775 g_clear_object (&manager->priv->settings_screensaver);
1776- g_clear_object (&manager->priv->settings_session);
1777+ g_clear_object (&manager->priv->settings_bus);
1778 g_clear_object (&manager->priv->up_client);
1779
1780 if (manager->priv->inhibit_lid_switch_fd != -1) {
1781@@ -3519,7 +3431,6 @@
1782 manager->priv->inhibit_lid_switch_fd = -1;
1783 manager->priv->inhibit_suspend_fd = -1;
1784 manager->priv->inhibit_lid_switch_action = FALSE;
1785- manager->priv->screensaver_cancellable = g_cancellable_new ();
1786 manager->priv->bus_cancellable = g_cancellable_new ();
1787 }
1788
1789@@ -3530,6 +3441,7 @@
1790 GVariant *parameters,
1791 GDBusMethodInvocation *invocation)
1792 {
1793+ gint now;
1794 gint step;
1795 gint value = -1;
1796 gboolean ret;
1797@@ -3538,19 +3450,23 @@
1798
1799 if (g_strcmp0 (method_name, "StepUp") == 0) {
1800 g_debug ("keyboard step up");
1801+ now = upower_kbd_get_brightness (manager);
1802 step = BRIGHTNESS_STEP_AMOUNT (manager->priv->kbd_brightness_max);
1803- value = MIN (manager->priv->kbd_brightness_now + step,
1804+ value = MIN (now + step,
1805 manager->priv->kbd_brightness_max);
1806 ret = upower_kbd_set_brightness (manager, value, &error);
1807
1808 } else if (g_strcmp0 (method_name, "StepDown") == 0) {
1809 g_debug ("keyboard step down");
1810+ now = upower_kbd_get_brightness (manager);
1811 step = BRIGHTNESS_STEP_AMOUNT (manager->priv->kbd_brightness_max);
1812- value = MAX (manager->priv->kbd_brightness_now - step, 0);
1813+ value = MAX (now - step, 0);
1814 ret = upower_kbd_set_brightness (manager, value, &error);
1815
1816 } else if (g_strcmp0 (method_name, "Toggle") == 0) {
1817- ret = upower_kbd_toggle (manager, &error);
1818+ value = upower_kbd_toggle (manager, &error);
1819+ ret = (value >= 0);
1820+
1821 } else {
1822 g_assert_not_reached ();
1823 }
1824
1825=== modified file 'plugins/remote-display/gsd-remote-display-manager.c'
1826--- plugins/remote-display/gsd-remote-display-manager.c 2013-02-16 04:55:53 +0000
1827+++ plugins/remote-display/gsd-remote-display-manager.c 2016-06-29 16:17:06 +0000
1828@@ -35,7 +35,7 @@
1829 #include <gdk/gdk.h>
1830 #include <gdk/gdkx.h>
1831
1832-#include "gnome-settings-session.h"
1833+#include "gnome-settings-bus.h"
1834 #include "gnome-settings-profile.h"
1835 #include "gsd-remote-display-manager.h"
1836
1837
1838=== modified file 'plugins/screensaver-proxy/gsd-screensaver-proxy-manager.c'
1839--- plugins/screensaver-proxy/gsd-screensaver-proxy-manager.c 2013-09-03 02:41:55 +0000
1840+++ plugins/screensaver-proxy/gsd-screensaver-proxy-manager.c 2016-06-29 16:17:06 +0000
1841@@ -28,15 +28,12 @@
1842 #include <string.h>
1843 #include <errno.h>
1844
1845-#include <locale.h>
1846-
1847-#include <glib.h>
1848-#include <glib/gi18n.h>
1849-#include <gdk/gdk.h>
1850-
1851-#include "gnome-settings-session.h"
1852+#include <gio/gio.h>
1853+
1854+#include "gnome-settings-bus.h"
1855 #include "gnome-settings-profile.h"
1856 #include "gsd-screensaver-proxy-manager.h"
1857+#include "gsd-idle-monitor.h"
1858
1859 #define GSD_SCREENSAVER_PROXY_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_SCREENSAVER_PROXY_MANAGER, GsdScreensaverProxyManagerPrivate))
1860
1861@@ -134,7 +131,8 @@
1862
1863 struct GsdScreensaverProxyManagerPrivate
1864 {
1865- GDBusProxy *session;
1866+ GsdSessionManager *session;
1867+ GsdScreenSaver *screensaver;
1868 GDBusConnection *connection;
1869 GCancellable *bus_cancellable;
1870 GDBusNodeInfo *introspection_data;
1871@@ -169,7 +167,7 @@
1872 if (g_strcmp0 (sender, name) == 0) {
1873 guint cookie = GPOINTER_TO_UINT (cookie_ptr);
1874
1875- g_dbus_proxy_call_sync (manager->priv->session,
1876+ g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->session),
1877 "Uninhibit",
1878 g_variant_new ("(u)", cookie),
1879 G_DBUS_CALL_FLAGS_NONE,
1880@@ -194,18 +192,19 @@
1881 gpointer user_data)
1882 {
1883 GsdScreensaverProxyManager *manager = GSD_SCREENSAVER_PROXY_MANAGER (user_data);
1884+ GError *error = NULL;
1885+ GVariant *ret = NULL;
1886
1887 /* Check session pointer as a proxy for whether the manager is in the
1888 start or stop state */
1889- if (manager->priv->session == NULL) {
1890- return;
1891+ if (manager->priv->session == NULL || manager->priv->screensaver == NULL) {
1892+ goto unimplemented;
1893 }
1894
1895 g_debug ("Calling method '%s.%s' for ScreenSaver Proxy",
1896 interface_name, method_name);
1897
1898 if (g_strcmp0 (method_name, "Inhibit") == 0) {
1899- GVariant *ret;
1900 const char *app_id;
1901 const char *reason;
1902 guint cookie;
1903@@ -213,12 +212,12 @@
1904 g_variant_get (parameters,
1905 "(ss)", &app_id, &reason);
1906
1907- ret = g_dbus_proxy_call_sync (manager->priv->session,
1908+ ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->session),
1909 "Inhibit",
1910 g_variant_new ("(susu)",
1911 app_id, 0, reason, GSM_INHIBITOR_FLAG_IDLE),
1912 G_DBUS_CALL_FLAGS_NONE,
1913- -1, NULL, NULL);
1914+ -1, NULL, &error);
1915 g_variant_get (ret, "(u)", &cookie);
1916 g_hash_table_insert (manager->priv->cookie_ht,
1917 GUINT_TO_POINTER (cookie),
1918@@ -237,36 +236,52 @@
1919 g_strdup (sender),
1920 GUINT_TO_POINTER (watch_id));
1921 }
1922- g_dbus_method_invocation_return_value (invocation, ret);
1923 } else if (g_strcmp0 (method_name, "UnInhibit") == 0) {
1924 guint cookie;
1925
1926 g_variant_get (parameters, "(u)", &cookie);
1927- g_dbus_proxy_call_sync (manager->priv->session,
1928+ g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->session),
1929 "Uninhibit",
1930 parameters,
1931 G_DBUS_CALL_FLAGS_NONE,
1932 -1, NULL, NULL);
1933 g_debug ("Removing cookie %u from the list for %s", cookie, sender);
1934 g_hash_table_remove (manager->priv->cookie_ht, GUINT_TO_POINTER (cookie));
1935- g_dbus_method_invocation_return_value (invocation, NULL);
1936- } else if (g_strcmp0 (method_name, "Throttle") == 0) {
1937- g_dbus_method_invocation_return_value (invocation, NULL);
1938- } else if (g_strcmp0 (method_name, "UnThrottle") == 0) {
1939- g_dbus_method_invocation_return_value (invocation, NULL);
1940- } else if (g_strcmp0 (method_name, "Lock") == 0) {
1941- goto unimplemented;
1942- } else if (g_strcmp0 (method_name, "SimulateUserActivity") == 0) {
1943- goto unimplemented;
1944- } else if (g_strcmp0 (method_name, "GetActive") == 0) {
1945- goto unimplemented;
1946- } else if (g_strcmp0 (method_name, "GetActiveTime") == 0) {
1947- goto unimplemented;
1948+ } else if (g_strcmp0 (method_name, "Lock") == 0 ||
1949+ g_strcmp0 (method_name, "SimulateUserActivity") == 0 ||
1950+ g_strcmp0 (method_name, "GetActive") == 0 ||
1951+ g_strcmp0 (method_name, "GetActiveTime") == 0 ||
1952+ g_strcmp0 (method_name, "SetActive") == 0) {
1953+
1954+ ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->screensaver),
1955+ method_name,
1956+ parameters,
1957+ G_DBUS_CALL_FLAGS_NONE,
1958+ -1, NULL, &error);
1959+
1960+ if (error == NULL && g_strcmp0 (method_name, "SetActive") == 0) {
1961+ g_variant_unref (ret);
1962+
1963+ /* Returning the actual Activate state here is not possible,
1964+ * as calling GetActive at this point might return an invalid
1965+ * value if the activation process is still ongoing. */
1966+ ret = g_variant_ref (parameters);
1967+ }
1968 } else if (g_strcmp0 (method_name, "GetSessionIdleTime") == 0) {
1969- goto unimplemented;
1970- } else if (g_strcmp0 (method_name, "SetActive") == 0) {
1971- goto unimplemented;
1972- }
1973+ GsdIdleMonitor *idle_monitor = gsd_idle_monitor_get_core ();
1974+ gint64 idle_time_ms = gsd_idle_monitor_get_idletime (idle_monitor);
1975+ ret = g_variant_new ("(u)", idle_time_ms / 1000);
1976+ } else {
1977+ goto unimplemented;
1978+ }
1979+
1980+ if (error != NULL) {
1981+ g_dbus_method_invocation_return_gerror (invocation, error);
1982+ g_error_free (error);
1983+ return;
1984+ }
1985+
1986+ g_dbus_method_invocation_return_value (invocation, ret);
1987
1988 return;
1989
1990@@ -353,7 +368,9 @@
1991 g_debug ("Starting screensaver-proxy manager");
1992 gnome_settings_profile_start (NULL);
1993 manager->priv->session =
1994- gnome_settings_session_get_session_proxy ();
1995+ gnome_settings_bus_get_session_proxy ();
1996+ manager->priv->screensaver =
1997+ gnome_settings_bus_get_screen_saver_proxy ();
1998 manager->priv->watch_ht = g_hash_table_new_full (g_str_hash,
1999 g_str_equal,
2000 (GDestroyNotify) g_free,
2001@@ -371,6 +388,7 @@
2002 {
2003 g_debug ("Stopping screensaver_proxy manager");
2004 g_clear_object (&manager->priv->session);
2005+ g_clear_object (&manager->priv->screensaver);
2006 g_clear_pointer (&manager->priv->watch_ht, g_hash_table_destroy);
2007 g_clear_pointer (&manager->priv->cookie_ht, g_hash_table_destroy);
2008 }
2009@@ -403,6 +421,8 @@
2010
2011 g_return_if_fail (manager->priv != NULL);
2012
2013+ gsd_screensaver_proxy_manager_stop (manager);
2014+
2015 if (manager->priv->name_id != 0) {
2016 g_bus_unown_name (manager->priv->name_id);
2017 manager->priv->name_id = 0;
2018
2019=== modified file 'plugins/smartcard/gsd-smartcard-plugin.c'
2020--- plugins/smartcard/gsd-smartcard-plugin.c 2012-10-22 08:00:50 +0000
2021+++ plugins/smartcard/gsd-smartcard-plugin.c 2016-06-29 16:17:06 +0000
2022@@ -28,13 +28,12 @@
2023 #include <gio/gio.h>
2024
2025 #include "gnome-settings-plugin.h"
2026-#include "gnome-settings-session.h"
2027+#include "gnome-settings-bus.h"
2028 #include "gsd-smartcard-plugin.h"
2029 #include "gsd-smartcard-manager.h"
2030
2031 struct GsdSmartcardPluginPrivate {
2032 GsdSmartcardManager *manager;
2033- GDBusConnection *bus_connection;
2034
2035 guint32 is_active : 1;
2036 };
2037@@ -46,10 +45,6 @@
2038 GSD_SMARTCARD_REMOVE_ACTION_FORCE_LOGOUT,
2039 } GsdSmartcardRemoveAction;
2040
2041-#define SCREENSAVER_DBUS_NAME "org.gnome.ScreenSaver"
2042-#define SCREENSAVER_DBUS_PATH "/"
2043-#define SCREENSAVER_DBUS_INTERFACE "org.gnome.ScreenSaver"
2044-
2045 #define SM_LOGOUT_MODE_FORCE 2
2046
2047 #define KEY_REMOVE_ACTION "removal-action"
2048@@ -61,20 +56,13 @@
2049 static void
2050 simulate_user_activity (GsdSmartcardPlugin *plugin)
2051 {
2052+ GsdScreenSaver *screensaver_proxy;
2053 GDBusProxy *screensaver_proxy;
2054
2055 g_debug ("GsdSmartcardPlugin telling screensaver about smart card insertion");
2056- screensaver_proxy = g_dbus_proxy_new_sync (plugin->priv->bus_connection,
2057- 0, NULL,
2058- SCREENSAVER_DBUS_NAME,
2059- SCREENSAVER_DBUS_PATH,
2060- SCREENSAVER_DBUS_INTERFACE,
2061- NULL, NULL);
2062-
2063- g_dbus_proxy_call (screensaver_proxy,
2064- "SimulateUserActivity",
2065- NULL, G_DBUS_CALL_FLAGS_NONE,
2066- -1, NULL, NULL, NULL);
2067+ screensaver_proxy = gnome_settings_bus_get_screen_saver_proxy ();
2068+ gsd_screen_saver_call_simulate_user_activity_sync (screensaver_proxy,
2069+ NULL, NULL);
2070
2071 g_object_unref (screensaver_proxy);
2072 }
2073@@ -85,17 +73,8 @@
2074 GDBusProxy *screensaver_proxy;
2075
2076 g_debug ("GsdSmartcardPlugin telling screensaver to lock screen");
2077- screensaver_proxy = g_dbus_proxy_new_sync (plugin->priv->bus_connection,
2078- 0, NULL,
2079- SCREENSAVER_DBUS_NAME,
2080- SCREENSAVER_DBUS_PATH,
2081- SCREENSAVER_DBUS_INTERFACE,
2082- NULL, NULL);
2083-
2084- g_dbus_proxy_call (screensaver_proxy,
2085- "Lock",
2086- NULL, G_DBUS_CALL_FLAGS_NONE,
2087- -1, NULL, NULL, NULL);
2088+ screensaver_proxy = gnome_settings_bus_get_screen_saver_proxy ();
2089+ gsd_screen_saver_call_lock_sync (screensaver_proxy, NULL, NULL);
2090
2091 g_object_unref (screensaver_proxy);
2092 }
2093@@ -108,7 +87,7 @@
2094 GVariant *res;
2095
2096 g_debug ("GsdSmartcardPlugin telling session manager to force logout");
2097- sm_proxy = gnome_settings_session_get_session_proxy ();
2098+ sm_proxy = gnome_settings_bus_get_session_proxy ();
2099
2100 error = NULL;
2101 res = g_dbus_proxy_call_sync (sm_proxy,
2102@@ -269,13 +248,6 @@
2103 g_debug ("GsdSmartcardPlugin Activating smartcard plugin");
2104
2105 error = NULL;
2106- smartcard_plugin->priv->bus_connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
2107-
2108- if (smartcard_plugin->priv->bus_connection == NULL) {
2109- g_warning ("GsdSmartcardPlugin Unable to connect to session bus: %s", error->message);
2110- return;
2111- }
2112-
2113 if (!gsd_smartcard_manager_start (smartcard_plugin->priv->manager, &error)) {
2114 g_warning ("GsdSmartcardPlugin Unable to start smartcard manager: %s", error->message);
2115 g_error_free (error);
2116@@ -318,7 +290,6 @@
2117
2118 g_signal_handlers_disconnect_by_func (smartcard_plugin->priv->manager,
2119 smartcard_inserted_cb, smartcard_plugin);
2120- smartcard_plugin->priv->bus_connection = NULL;
2121 smartcard_plugin->priv->is_active = FALSE;
2122 }
2123
2124
2125=== modified file 'plugins/updates/gsd-updates-manager.c'
2126--- plugins/updates/gsd-updates-manager.c 2013-09-05 09:48:46 +0000
2127+++ plugins/updates/gsd-updates-manager.c 2016-06-29 16:17:06 +0000
2128@@ -35,7 +35,7 @@
2129 #include "gsd-updates-refresh.h"
2130 #include "gsd-updates-common.h"
2131 #include "gnome-settings-profile.h"
2132-#include "gnome-settings-session.h"
2133+#include "gnome-settings-bus.h"
2134
2135 #define GSD_UPDATES_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_UPDATES_MANAGER, GsdUpdatesManagerPrivate))
2136
2137@@ -60,7 +60,7 @@
2138 PkControl *control;
2139 PkTask *task;
2140 guint inhibit_cookie;
2141- GDBusProxy *proxy_session;
2142+ GsdSessionManager *proxy_session;
2143 guint update_viewer_watcher_id;
2144 GVolumeMonitor *volume_monitor;
2145 guint failed_get_updates_count;
2146@@ -975,7 +975,7 @@
2147
2148 /* TRANSLATORS: the reason why we've inhibited it */
2149 reason = _("A transaction that cannot be interrupted is running");
2150- retval = g_dbus_proxy_call_sync (manager->priv->proxy_session,
2151+ retval = g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->proxy_session),
2152 "Inhibit",
2153 g_variant_new ("(susu)",
2154 "gnome-settings-daemon", /* app-id */
2155@@ -1012,7 +1012,7 @@
2156 g_warning ("not locked");
2157 goto out;
2158 }
2159- retval = g_dbus_proxy_call_sync (manager->priv->proxy_session,
2160+ retval = g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->proxy_session),
2161 "Uninhibit",
2162 g_variant_new ("(u)",
2163 manager->priv->inhibit_cookie),
2164@@ -1328,7 +1328,7 @@
2165
2166 /* use gnome-session for the idle detection */
2167 manager->priv->proxy_session =
2168- gnome_settings_session_get_session_proxy ();
2169+ gnome_settings_bus_get_session_proxy ();
2170 if (manager->priv->proxy_session == NULL)
2171 goto out;
2172
2173
2174=== modified file 'plugins/updates/gsd-updates-refresh.c'
2175--- plugins/updates/gsd-updates-refresh.c 2013-05-28 08:37:55 +0000
2176+++ plugins/updates/gsd-updates-refresh.c 2016-06-29 16:17:06 +0000
2177@@ -25,7 +25,7 @@
2178 #include <packagekit-glib2/packagekit.h>
2179 #include <libupower-glib/upower.h>
2180
2181-#include "gnome-settings-session.h"
2182+#include "gnome-settings-bus.h"
2183
2184 #include "gsd-updates-common.h"
2185 #include "gsd-updates-refresh.h"
2186@@ -64,7 +64,7 @@
2187 guint periodic_id;
2188 UpClient *client;
2189 GSettings *settings;
2190- GDBusProxy *proxy_session;
2191+ GsdSessionManager *proxy_session;
2192 PkControl *control;
2193 };
2194
2195@@ -506,13 +506,13 @@
2196
2197 /* use gnome-session for the idle detection */
2198 refresh->priv->proxy_session =
2199- gnome_settings_session_get_session_proxy ();
2200+ gnome_settings_bus_get_session_proxy ();
2201 if (refresh->priv->proxy_session != NULL) {
2202- g_signal_connect (refresh->priv->proxy_session,
2203+ g_signal_connect (G_DBUS_PROXY (refresh->priv->proxy_session),
2204 "g-signal",
2205 G_CALLBACK (session_presence_signal_cb),
2206 refresh);
2207- status = g_dbus_proxy_get_cached_property (refresh->priv->proxy_session,
2208+ status = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (refresh->priv->proxy_session),
2209 "status");
2210 if (status) {
2211 g_variant_get (status, "u", &status_code);
2212
2213=== modified file 'plugins/wacom/gsd-wacom-manager.c'
2214--- plugins/wacom/gsd-wacom-manager.c 2015-10-22 10:52:11 +0000
2215+++ plugins/wacom/gsd-wacom-manager.c 2016-06-29 16:17:06 +0000
2216@@ -167,6 +167,8 @@
2217 XDevice *xdev;
2218
2219 xdev = open_device (device);
2220+ if (xdev == NULL)
2221+ return;
2222 device_set_property (xdev, gsd_wacom_device_get_tool_name (device), property);
2223 xdevice_close (xdev);
2224 }
2225@@ -310,6 +312,8 @@
2226 XDevice *xdev;
2227
2228 xdev = open_device (device);
2229+ if (xdev == NULL)
2230+ return;
2231 gdk_error_trap_push ();
2232 XSetDeviceMode (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), xdev, is_absolute ? Absolute : Relative);
2233 if (gdk_error_trap_pop ())
2234@@ -438,6 +442,8 @@
2235 int i, j, rc;
2236
2237 xdev = open_device (device);
2238+ if (xdev == NULL)
2239+ return;
2240
2241 intmap = g_variant_get_fixed_array (value, &nmap, sizeof (gint32));
2242 map = g_new0 (unsigned char, nmap);
2243@@ -661,6 +667,8 @@
2244
2245 /* Normal buttons */
2246 xdev = open_device (device);
2247+ if (xdev == NULL)
2248+ return;
2249
2250 gdk_error_trap_push ();
2251
2252
2253=== modified file 'plugins/xrandr/gsd-xrandr-manager.c'
2254--- plugins/xrandr/gsd-xrandr-manager.c 2015-10-07 16:07:14 +0000
2255+++ plugins/xrandr/gsd-xrandr-manager.c 2016-06-29 16:17:06 +0000
2256@@ -49,7 +49,7 @@
2257 #include "gsd-input-helper.h"
2258 #include "gnome-settings-plugin.h"
2259 #include "gnome-settings-profile.h"
2260-#include "gnome-settings-session.h"
2261+#include "gnome-settings-bus.h"
2262 #include "gsd-xrandr-manager.h"
2263 #include "gsd-rr-config.h"
2264 #include "gsd-rr.h"
2265
2266=== modified file 'plugins/xsettings/gsd-xsettings-manager.c'
2267--- plugins/xsettings/gsd-xsettings-manager.c 2016-02-09 09:56:17 +0000
2268+++ plugins/xsettings/gsd-xsettings-manager.c 2016-06-29 16:17:06 +0000
2269@@ -434,6 +434,29 @@
2270 return dpi * factor;
2271 }
2272
2273+static gboolean
2274+in_desktop (const gchar *name)
2275+{
2276+ const gchar *desktop_name_list;
2277+ gchar **names;
2278+ gboolean in_list = FALSE;
2279+ gint i;
2280+
2281+ desktop_name_list = g_getenv ("XDG_CURRENT_DESKTOP");
2282+ if (!desktop_name_list)
2283+ return FALSE;
2284+
2285+ names = g_strsplit (desktop_name_list, ":", -1);
2286+ for (i = 0; names[i] && !in_list; i++)
2287+ if (strcmp (names[i], name) == 0) {
2288+ in_list = TRUE;
2289+ break;
2290+ }
2291+ g_strfreev (names);
2292+
2293+ return in_list;
2294+}
2295+
2296 static int
2297 get_window_scale (GnomeXSettingsManager *manager)
2298 {
2299@@ -453,7 +476,7 @@
2300 window_scale = 1;
2301
2302 /* Under Unity let the shell handle the scaling */
2303- if (g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0)
2304+ if (in_desktop ("Unity"))
2305 goto out;
2306
2307 display = gdk_display_get_default ();

Subscribers

People subscribed via source and target branches