Merge lp:~3v1n0/unity-settings-daemon/remove-duplicated-dbus-proxies into lp:unity-settings-daemon

Proposed by Marco Trevisan (Treviño)
Status: Superseded
Proposed branch: lp:~3v1n0/unity-settings-daemon/remove-duplicated-dbus-proxies
Merge into: lp:unity-settings-daemon
Diff against target: 1570 lines (+745/-280)
19 files modified
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-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.SessionManager.xml (+451/-0)
plugins/automount/gsd-automount-manager.c (+0/-1)
plugins/background/gsd-background-manager.c (+0/-1)
plugins/color/gsd-color-manager.c (+2/-2)
plugins/keyboard/gsd-keyboard-manager.c (+1/-1)
plugins/media-keys/gsd-media-keys-manager.c (+31/-18)
plugins/power/gsd-power-manager.c (+81/-137)
plugins/remote-display/gsd-remote-display-manager.c (+1/-1)
plugins/screensaver-proxy/gsd-screensaver-proxy-manager.c (+6/-6)
plugins/smartcard/gsd-smartcard-plugin.c (+0/-1)
plugins/updates/gsd-updates-manager.c (+5/-5)
plugins/updates/gsd-updates-refresh.c (+5/-5)
plugins/xrandr/gsd-xrandr-manager.c (+1/-1)
To merge this branch: bzr merge lp:~3v1n0/unity-settings-daemon/remove-duplicated-dbus-proxies
Reviewer Review Type Date Requested Status
Unity Settings Daemon Development Team Pending
Review via email: mp+295352@code.launchpad.net

Commit message

common: backport g-s-d commits for having single shared dbus proxies

541cf96 - common: generate session manager proxy
2cabb3a - common: rename gnome-settings-session to gnome-settings-bus
4a0fabd - common: move screensaver proxy fetching into common code

GNOME bug: https://bugzilla.gnome.org/show_bug.cgi?id=705127

Description of the change

Backporting some commits from gsd related to bug https://bugzilla.gnome.org/show_bug.cgi?id=705127, these are prerequisites for fixing bug #1584161

To post a comment you must log in.
4137. By Marco Trevisan (Treviño)

screensaver-proxy: Call stop from finalize

Backporting commit e73f280cc

4138. By Marco Trevisan (Treviño)

BackgroundManager: use shared session proxy

4139. By Marco Trevisan (Treviño)

AutomountManager: use shared screensaver proxy

4140. By Marco Trevisan (Treviño)

ColorManager: use shared session proxy

4141. By Marco Trevisan (Treviño)

Smartcard: use shared screensaver proxy

4142. By Marco Trevisan (Treviño)

Merging with lp:~3v1n0/unity-settings-daemon/kbd-brightness-update

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gnome-settings-daemon/Makefile.am'
2--- gnome-settings-daemon/Makefile.am 2014-10-07 01:58:12 +0000
3+++ gnome-settings-daemon/Makefile.am 2016-05-20 17:57:13 +0000
4@@ -1,4 +1,5 @@
5 NULL =
6+BUILT_SOURCES = $(NULL)
7
8 INCLUDES = \
9 -DDATADIR=\""$(datadir)"\" \
10@@ -80,11 +81,38 @@
11 libgsd.la \
12 $(NULL)
13
14+session_manager_dbus_built_sources = gsd-session-manager-glue.c gsd-session-manager-glue.h
15+BUILT_SOURCES += $(session_manager_dbus_built_sources)
16+
17+$(session_manager_dbus_built_sources) : Makefile.am org.gnome.SessionManager.xml
18+ gdbus-codegen \
19+ --interface-prefix org.gnome.SessionManager. \
20+ --generate-c-code gsd-session-manager-glue \
21+ --c-namespace Gsd \
22+ --annotate "org.gnome.SessionManager" \
23+ "org.gtk.GDBus.C.Name" SessionManager \
24+ $(srcdir)/org.gnome.SessionManager.xml
25+
26+screen_saver_dbus_built_sources = gsd-screen-saver-glue.c gsd-screen-saver-glue.h
27+
28+BUILT_SOURCES += $(screen_saver_dbus_built_sources)
29+
30+$(screen_saver_dbus_built_sources) : Makefile.am org.gnome.ScreenSaver.xml
31+ gdbus-codegen \
32+ --interface-prefix org.gnome.ScreenSaver. \
33+ --generate-c-code gsd-screen-saver-glue \
34+ --c-namespace Gsd \
35+ --annotate "org.gnome.ScreenSaver" \
36+ "org.gtk.GDBus.C.Name" ScreenSaver \
37+ $(srcdir)/org.gnome.ScreenSaver.xml
38+
39 libgsd_la_SOURCES = \
40+ $(session_manager_dbus_built_sources) \
41+ $(screen_saver_dbus_built_sources) \
42 gnome-settings-profile.c \
43 gnome-settings-profile.h \
44- gnome-settings-session.c \
45- gnome-settings-session.h \
46+ gnome-settings-bus.c \
47+ gnome-settings-bus.h \
48 $(NULL)
49
50 libgsd_la_CPPFLAGS = \
51@@ -115,7 +143,10 @@
52
53 EXTRA_DIST = \
54 unity-settings-daemon-localeexec.in \
55- idle-monitor.xml
56+ org.gnome.SessionManager.xml \
57+ org.gnome.ScreenSaver.xml \
58+ idle-monitor.xml \
59+ $(NULL)
60
61 unity-settings-daemon-localeexec: unity-settings-daemon-localeexec.in
62 $(AM_V_GEN) sed -e "s|\@libexecdir\@|$(libexecdir)|" -e "s|\@prefix\@|$(prefix)|" $< > $@.tmp && mv $@.tmp $@
63
64=== added file 'gnome-settings-daemon/gnome-settings-bus.c'
65--- gnome-settings-daemon/gnome-settings-bus.c 1970-01-01 00:00:00 +0000
66+++ gnome-settings-daemon/gnome-settings-bus.c 2016-05-20 17:57:13 +0000
67@@ -0,0 +1,89 @@
68+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
69+ *
70+ * Copyright (C) 2006-2011 Richard Hughes <richard@hughsie.com>
71+ *
72+ * Licensed under the GNU General Public License Version 2
73+ *
74+ * This program is free software; you can redistribute it and/or modify
75+ * it under the terms of the GNU General Public License as published by
76+ * the Free Software Foundation; either version 2 of the License, or
77+ * (at your option) any later version.
78+ *
79+ * This program is distributed in the hope that it will be useful,
80+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
81+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
82+ * GNU General Public License for more details.
83+ *
84+ * You should have received a copy of the GNU General Public License
85+ * along with this program; if not, write to the Free Software
86+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
87+ */
88+
89+#include "config.h"
90+
91+#include <string.h>
92+#include <unistd.h>
93+#include <stdio.h>
94+#include <glib.h>
95+#include <gio/gio.h>
96+
97+#include "gnome-settings-bus.h"
98+
99+#define GNOME_SESSION_DBUS_NAME "org.gnome.SessionManager"
100+#define GNOME_SESSION_DBUS_OBJECT "/org/gnome/SessionManager"
101+
102+#define GNOME_SCREENSAVER_DBUS_NAME "org.gnome.ScreenSaver"
103+#define GNOME_SCREENSAVER_DBUS_OBJECT "/org/gnome/ScreenSaver"
104+
105+GsdSessionManager *
106+gnome_settings_bus_get_session_proxy (void)
107+{
108+ static GsdSessionManager *session_proxy;
109+ GError *error = NULL;
110+
111+ if (session_proxy != NULL) {
112+ g_object_ref (session_proxy);
113+ } else {
114+ session_proxy = gsd_session_manager_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
115+ G_DBUS_PROXY_FLAGS_NONE,
116+ GNOME_SESSION_DBUS_NAME,
117+ GNOME_SESSION_DBUS_OBJECT,
118+ NULL,
119+ &error);
120+ if (error) {
121+ g_warning ("Failed to connect to the session manager: %s", error->message);
122+ g_error_free (error);
123+ } else {
124+ g_object_add_weak_pointer (G_OBJECT (session_proxy), (gpointer*)&session_proxy);
125+ }
126+ }
127+
128+ return session_proxy;
129+}
130+
131+GsdScreenSaver *
132+gnome_settings_bus_get_screen_saver_proxy (void)
133+{
134+ static GsdScreenSaver *screen_saver_proxy;
135+ GError *error = NULL;
136+
137+ if (screen_saver_proxy != NULL) {
138+ g_object_ref (screen_saver_proxy);
139+ } else {
140+ screen_saver_proxy = gsd_screen_saver_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
141+ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
142+ G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
143+ GNOME_SCREENSAVER_DBUS_NAME,
144+ GNOME_SCREENSAVER_DBUS_OBJECT,
145+ NULL,
146+ &error);
147+ if (error) {
148+ g_warning ("Failed to connect to the screen saver: %s", error->message);
149+ g_error_free (error);
150+ } else {
151+ g_object_add_weak_pointer (G_OBJECT (screen_saver_proxy), (gpointer*)&screen_saver_proxy);
152+ }
153+ }
154+
155+ return screen_saver_proxy;
156+}
157
158=== added file 'gnome-settings-daemon/gnome-settings-bus.h'
159--- gnome-settings-daemon/gnome-settings-bus.h 1970-01-01 00:00:00 +0000
160+++ gnome-settings-daemon/gnome-settings-bus.h 2016-05-20 17:57:13 +0000
161@@ -0,0 +1,36 @@
162+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
163+ *
164+ * Copyright (C) 2010-2011 Richard Hughes <richard@hughsie.com>
165+ *
166+ * Licensed under the GNU General Public License Version 2
167+ *
168+ * This program is free software; you can redistribute it and/or modify
169+ * it under the terms of the GNU General Public License as published by
170+ * the Free Software Foundation; either version 2 of the License, or
171+ * (at your option) any later version.
172+ *
173+ * This program is distributed in the hope that it will be useful,
174+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
175+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
176+ * GNU General Public License for more details.
177+ *
178+ * You should have received a copy of the GNU General Public License
179+ * along with this program; if not, write to the Free Software
180+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
181+ */
182+
183+#ifndef __GNOME_SETTINGS_BUS_H
184+#define __GNOME_SETTINGS_BUS_H
185+
186+#include <glib-object.h>
187+#include "gsd-session-manager-glue.h"
188+#include "gsd-screen-saver-glue.h"
189+
190+G_BEGIN_DECLS
191+
192+GsdSessionManager *gnome_settings_bus_get_session_proxy (void);
193+GsdScreenSaver *gnome_settings_bus_get_screen_saver_proxy (void);
194+
195+G_END_DECLS
196+
197+#endif /* __GNOME_SETTINGS_BUS_H */
198
199=== removed file 'gnome-settings-daemon/gnome-settings-session.c'
200--- gnome-settings-daemon/gnome-settings-session.c 2012-11-12 13:53:19 +0000
201+++ gnome-settings-daemon/gnome-settings-session.c 1970-01-01 00:00:00 +0000
202@@ -1,62 +0,0 @@
203-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
204- *
205- * Copyright (C) 2006-2011 Richard Hughes <richard@hughsie.com>
206- *
207- * Licensed under the GNU General Public License Version 2
208- *
209- * This program is free software; you can redistribute it and/or modify
210- * it under the terms of the GNU General Public License as published by
211- * the Free Software Foundation; either version 2 of the License, or
212- * (at your option) any later version.
213- *
214- * This program is distributed in the hope that it will be useful,
215- * but WITHOUT ANY WARRANTY; without even the implied warranty of
216- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
217- * GNU General Public License for more details.
218- *
219- * You should have received a copy of the GNU General Public License
220- * along with this program; if not, write to the Free Software
221- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
222- */
223-
224-#include "config.h"
225-
226-#include <string.h>
227-#include <unistd.h>
228-#include <stdio.h>
229-#include <glib.h>
230-#include <gio/gio.h>
231-
232-#include "gnome-settings-session.h"
233-
234-#define GNOME_SESSION_DBUS_NAME "org.gnome.SessionManager"
235-#define GNOME_SESSION_DBUS_OBJECT "/org/gnome/SessionManager"
236-#define GNOME_SESSION_DBUS_INTERFACE "org.gnome.SessionManager"
237-
238-GDBusProxy *
239-gnome_settings_session_get_session_proxy (void)
240-{
241- static GDBusProxy *session_proxy;
242- GError *error = NULL;
243-
244- if (session_proxy != NULL) {
245- g_object_ref (session_proxy);
246- } else {
247- session_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
248- G_DBUS_PROXY_FLAGS_NONE,
249- NULL,
250- GNOME_SESSION_DBUS_NAME,
251- GNOME_SESSION_DBUS_OBJECT,
252- GNOME_SESSION_DBUS_INTERFACE,
253- NULL,
254- &error);
255- if (error) {
256- g_warning ("Failed to connect to the session manager: %s", error->message);
257- g_error_free (error);
258- } else {
259- g_object_add_weak_pointer (G_OBJECT (session_proxy), (gpointer*)&session_proxy);
260- }
261- }
262-
263- return session_proxy;
264-}
265
266=== removed file 'gnome-settings-daemon/gnome-settings-session.h'
267--- gnome-settings-daemon/gnome-settings-session.h 2012-11-12 09:12:14 +0000
268+++ gnome-settings-daemon/gnome-settings-session.h 1970-01-01 00:00:00 +0000
269@@ -1,34 +0,0 @@
270-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
271- *
272- * Copyright (C) 2010-2011 Richard Hughes <richard@hughsie.com>
273- *
274- * Licensed under the GNU General Public License Version 2
275- *
276- * This program is free software; you can redistribute it and/or modify
277- * it under the terms of the GNU General Public License as published by
278- * the Free Software Foundation; either version 2 of the License, or
279- * (at your option) any later version.
280- *
281- * This program is distributed in the hope that it will be useful,
282- * but WITHOUT ANY WARRANTY; without even the implied warranty of
283- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
284- * GNU General Public License for more details.
285- *
286- * You should have received a copy of the GNU General Public License
287- * along with this program; if not, write to the Free Software
288- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
289- */
290-
291-#ifndef __GNOME_SETTINGS_SESSION_H
292-#define __GNOME_SETTINGS_SESSION_H
293-
294-#include <glib-object.h>
295-
296-G_BEGIN_DECLS
297-
298-GDBusProxy *gnome_settings_session_get_session_proxy (void);
299-
300-G_END_DECLS
301-
302-#endif /* __GNOME_SETTINGS_SESSION_H */
303-
304
305=== modified file 'gnome-settings-daemon/main.c'
306--- gnome-settings-daemon/main.c 2014-10-07 22:07:40 +0000
307+++ gnome-settings-daemon/main.c 2016-05-20 17:57:13 +0000
308@@ -36,7 +36,7 @@
309 #include "gnome-settings-manager.h"
310 #include "gnome-settings-plugin.h"
311 #include "gnome-settings-profile.h"
312-#include "gnome-settings-session.h"
313+#include "gnome-settings-bus.h"
314 #include "gsd-idle-monitor-private.h"
315
316 #define GNOME_SESSION_DBUS_NAME "org.gnome.SessionManager"
317@@ -351,7 +351,7 @@
318 {
319 GDBusProxy *proxy;
320
321- proxy = gnome_settings_session_get_session_proxy ();
322+ proxy = G_DBUS_PROXY (gnome_settings_bus_get_session_proxy ());
323 #ifdef HAVE_IBUS
324 set_legacy_ibus_env_vars (proxy);
325 #endif
326
327=== added file 'gnome-settings-daemon/org.gnome.SessionManager.xml'
328--- gnome-settings-daemon/org.gnome.SessionManager.xml 1970-01-01 00:00:00 +0000
329+++ gnome-settings-daemon/org.gnome.SessionManager.xml 2016-05-20 17:57:13 +0000
330@@ -0,0 +1,451 @@
331+<?xml version="1.0" encoding="UTF-8" ?>
332+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
333+<node xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
334+ <interface name="org.gnome.SessionManager">
335+
336+ <!-- Initialization phase interfaces -->
337+
338+ <method name="Setenv">
339+ <arg name="variable" type="s" direction="in">
340+ <doc:doc>
341+ <doc:summary>The variable name</doc:summary>
342+ </doc:doc>
343+ </arg>
344+ <arg name="value" type="s" direction="in">
345+ <doc:doc>
346+ <doc:summary>The value</doc:summary>
347+ </doc:doc>
348+ </arg>
349+ <doc:doc>
350+ <doc:description>
351+ <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>
352+ </doc:description>
353+ </doc:doc>
354+ </method>
355+
356+ <method name="GetLocale">
357+ <arg name="category" type="i" direction="in">
358+ <doc:doc>
359+ <doc:summary>The locale category</doc:summary>
360+ </doc:doc>
361+ </arg>
362+ <arg name="value" type="s" direction="out">
363+ <doc:doc>
364+ <doc:summary>The value</doc:summary>
365+ </doc:doc>
366+ </arg>
367+ <doc:doc>
368+ <doc:description>
369+ <doc:para>Reads the current state of the specific locale category.</doc:para>
370+ </doc:description>
371+ </doc:doc>
372+ </method>
373+
374+ <method name="InitializationError">
375+ <arg name="message" type="s" direction="in">
376+ <doc:doc>
377+ <doc:summary>The error message</doc:summary>
378+ </doc:doc>
379+ </arg>
380+ <arg name="fatal" type="b" direction="in">
381+ <doc:doc>
382+ <doc:summary>Whether the error should be treated as fatal</doc:summary>
383+ </doc:doc>
384+ </arg>
385+ <doc:doc>
386+ <doc:description>
387+ <doc:para>May be used by applications launched during the Session Manager initialization phase to indicate there was a problem.</doc:para>
388+ </doc:description>
389+ </doc:doc>
390+ </method>
391+
392+ <!-- Running phase interfaces -->
393+
394+ <method name="RegisterClient">
395+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
396+ <arg type="s" name="app_id" direction="in">
397+ <doc:doc>
398+ <doc:summary>The application identifier</doc:summary>
399+ </doc:doc>
400+ </arg>
401+ <arg type="s" name="client_startup_id" direction="in">
402+ <doc:doc>
403+ <doc:summary>Client startup identifier</doc:summary>
404+ </doc:doc>
405+ </arg>
406+ <arg type="o" name="client_id" direction="out">
407+ <doc:doc>
408+ <doc:summary>The object path of the newly registered client</doc:summary>
409+ </doc:doc>
410+ </arg>
411+ <doc:doc>
412+ <doc:description>
413+ <doc:para>Register the caller as a Session Management client.</doc:para>
414+ </doc:description>
415+ </doc:doc>
416+ </method>
417+
418+ <method name="UnregisterClient">
419+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
420+ <arg type="o" name="client_id" direction="in">
421+ <doc:doc>
422+ <doc:summary>The object path of the client</doc:summary>
423+ </doc:doc>
424+ </arg>
425+ <doc:doc>
426+ <doc:description>
427+ <doc:para>Unregister the specified client from Session Management.</doc:para>
428+ </doc:description>
429+ </doc:doc>
430+ </method>
431+
432+ <method name="Inhibit">
433+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
434+ <arg type="s" name="app_id" direction="in">
435+ <doc:doc>
436+ <doc:summary>The application identifier</doc:summary>
437+ </doc:doc>
438+ </arg>
439+ <arg type="u" name="toplevel_xid" direction="in">
440+ <doc:doc>
441+ <doc:summary>The toplevel X window identifier</doc:summary>
442+ </doc:doc>
443+ </arg>
444+ <arg type="s" name="reason" direction="in">
445+ <doc:doc>
446+ <doc:summary>The reason for the inhibit</doc:summary>
447+ </doc:doc>
448+ </arg>
449+ <arg type="u" name="flags" direction="in">
450+ <doc:doc>
451+ <doc:summary>Flags that specify what should be inhibited</doc:summary>
452+ </doc:doc>
453+ </arg>
454+ <arg type="u" name="inhibit_cookie" direction="out">
455+ <doc:doc>
456+ <doc:summary>The cookie</doc:summary>
457+ </doc:doc>
458+ </arg>
459+ <doc:doc>
460+ <doc:summary>
461+ 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.
462+ </doc:summary>
463+ <doc:description>
464+ <doc:para>Applications should invoke this method when they begin an operation that
465+ should not be interrupted, such as creating a CD or DVD. The types of actions
466+ that may be blocked are specified by the flags parameter. When the application
467+ completes the operation it should call <doc:ref type="method" to="org.gnome.SessionManager.Uninhibit">Uninhibit()</doc:ref>
468+ or disconnect from the session bus.
469+ </doc:para>
470+ <doc:para>
471+ Applications should not expect that they will always be able to block the
472+ action. In most cases, users will be given the option to force the action
473+ to take place.
474+ </doc:para>
475+ <doc:para>
476+ Reasons should be short and to the point.
477+ </doc:para>
478+ <doc:para>
479+ The flags parameter must include at least one of the following:
480+ <doc:list>
481+ <doc:item>
482+ <doc:term>1</doc:term>
483+ <doc:definition>Inhibit logging out</doc:definition>
484+ </doc:item>
485+ <doc:item>
486+ <doc:term>2</doc:term>
487+ <doc:definition>Inhibit user switching</doc:definition>
488+ </doc:item>
489+ <doc:item>
490+ <doc:term>4</doc:term>
491+ <doc:definition>Inhibit suspending the session or computer</doc:definition>
492+ </doc:item>
493+ <doc:item>
494+ <doc:term>8</doc:term>
495+ <doc:definition>Inhibit the session being marked as idle</doc:definition>
496+ </doc:item>
497+ <doc:item>
498+ <doc:term>16</doc:term>
499+ <doc:definition>Inhibit auto-mounting removable media for the session</doc:definition>
500+ </doc:item>
501+ </doc:list>
502+ Values for flags may be bitwise or'ed together.
503+ </doc:para>
504+ <doc:para>
505+ The returned cookie is used to uniquely identify this request. It should be used
506+ as an argument to <doc:ref type="method" to="org.gnome.SessionManager.Uninhibit">Uninhibit()</doc:ref> in
507+ order to remove the request.
508+ </doc:para>
509+ </doc:description>
510+ </doc:doc>
511+ </method>
512+
513+ <method name="Uninhibit">
514+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
515+ <arg type="u" name="inhibit_cookie" direction="in">
516+ <doc:doc>
517+ <doc:summary>The cookie</doc:summary>
518+ </doc:doc>
519+ </arg>
520+ <doc:doc>
521+ <doc:description>
522+ <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>
523+ </doc:description>
524+ </doc:doc>
525+ </method>
526+
527+ <method name="IsInhibited">
528+ <arg type="u" name="flags" direction="in">
529+ <doc:doc>
530+ <doc:summary>Flags that spefify what should be inhibited</doc:summary>
531+ </doc:doc>
532+ </arg>
533+ <arg type="b" name="is_inhibited" direction="out">
534+ <doc:doc>
535+ <doc:summary>Returns TRUE if any of the operations in the bitfield flags are inhibited</doc:summary>
536+ </doc:doc>
537+ </arg>
538+ <doc:doc>
539+ <doc:description>
540+ <doc:para>Determine if operation(s) specified by the flags
541+ are currently inhibited. Flags are same as those accepted
542+ by the
543+ <doc:ref type="method" to="org.gnome.SessionManager.Inhibit">Inhibit()</doc:ref>
544+ method.</doc:para>
545+ </doc:description>
546+ </doc:doc>
547+ </method>
548+
549+ <method name="GetClients">
550+ <arg name="clients" direction="out" type="ao">
551+ <doc:doc>
552+ <doc:summary>an array of client IDs</doc:summary>
553+ </doc:doc>
554+ </arg>
555+ <doc:doc>
556+ <doc:description>
557+ <doc:para>This gets a list of all the <doc:ref type="interface" to="org.gnome.SessionManager.Client">Clients</doc:ref>
558+ that are currently known to the session manager.</doc:para>
559+ <doc:para>Each Client ID is an D-Bus object path for the object that implements the
560+ <doc:ref type="interface" to="org.gnome.SessionManager.Client">Client</doc:ref> interface.</doc:para>
561+ </doc:description>
562+ <doc:seealso><doc:ref type="interface" to="org.gnome.SessionManager.Client">org.gnome.SessionManager.Client</doc:ref></doc:seealso>
563+ </doc:doc>
564+ </method>
565+
566+ <method name="GetInhibitors">
567+ <arg name="inhibitors" direction="out" type="ao">
568+ <doc:doc>
569+ <doc:summary>an array of inhibitor IDs</doc:summary>
570+ </doc:doc>
571+ </arg>
572+ <doc:doc>
573+ <doc:description>
574+ <doc:para>This gets a list of all the <doc:ref type="interface" to="org.gnome.SessionManager.Inhibitor">Inhibitors</doc:ref>
575+ that are currently known to the session manager.</doc:para>
576+ <doc:para>Each Inhibitor ID is an D-Bus object path for the object that implements the
577+ <doc:ref type="interface" to="org.gnome.SessionManager.Inhibitor">Inhibitor</doc:ref> interface.</doc:para>
578+ </doc:description>
579+ <doc:seealso><doc:ref type="interface" to="org.gnome.SessionManager.Inhibitor">org.gnome.SessionManager.Inhibitor</doc:ref></doc:seealso>
580+ </doc:doc>
581+ </method>
582+
583+
584+ <method name="IsAutostartConditionHandled">
585+ <arg name="condition" direction="in" type="s">
586+ <doc:doc>
587+ <doc:summary>The autostart condition string</doc:summary>
588+ </doc:doc>
589+ </arg>
590+ <arg name="handled" direction="out" type="b">
591+ <doc:doc>
592+ <doc:summary>True if condition is handled, false otherwise</doc:summary>
593+ </doc:doc>
594+ </arg>
595+ <doc:doc>
596+ <doc:description>
597+ <doc:para>Allows the caller to determine whether the session manager is
598+ handling changes to the specified autostart condition.</doc:para>
599+ </doc:description>
600+ </doc:doc>
601+ </method>
602+
603+ <method name="Shutdown">
604+ <doc:doc>
605+ <doc:description>
606+ <doc:para>Request a shutdown dialog.</doc:para>
607+ </doc:description>
608+ </doc:doc>
609+ </method>
610+
611+ <method name="Reboot">
612+ <doc:doc>
613+ <doc:description>
614+ <doc:para>Request a reboot dialog.</doc:para>
615+ </doc:description>
616+ </doc:doc>
617+ </method>
618+
619+ <method name="CanShutdown">
620+ <arg name="is_available" direction="out" type="b">
621+ <doc:doc>
622+ <doc:summary>True if shutdown is available to the user, false otherwise</doc:summary>
623+ </doc:doc>
624+ </arg>
625+ <doc:doc>
626+ <doc:description>
627+ <doc:para>Allows the caller to determine whether or not it's okay to show
628+ a shutdown option in the UI</doc:para>
629+ </doc:description>
630+ </doc:doc>
631+ </method>
632+
633+ <method name="Logout">
634+ <arg name="mode" type="u" direction="in">
635+ <doc:doc>
636+ <doc:summary>The type of logout that is being requested</doc:summary>
637+ </doc:doc>
638+ </arg>
639+ <doc:doc>
640+ <doc:description>
641+ <doc:para>Request a logout dialog</doc:para>
642+ <doc:para>
643+ Allowed values for the mode parameter are:
644+ <doc:list>
645+ <doc:item>
646+ <doc:term>0</doc:term>
647+ <doc:definition>Normal.</doc:definition>
648+ </doc:item>
649+ <doc:item>
650+ <doc:term>1</doc:term>
651+ <doc:definition>No confirmation inferface should be shown.</doc:definition>
652+ </doc:item>
653+ <doc:item>
654+ <doc:term>2</doc:term>
655+ <doc:definition>Forcefully logout. No confirmation will be shown and any inhibitors will be ignored.</doc:definition>
656+ </doc:item>
657+ </doc:list>
658+ Values for flags may be bitwise or'ed together.
659+ </doc:para>
660+ </doc:description>
661+ </doc:doc>
662+ </method>
663+
664+ <method name="IsSessionRunning">
665+ <arg name="running" direction="out" type="b">
666+ <doc:doc>
667+ <doc:summary>True if the session has entered the Running phase, false otherwise</doc:summary>
668+ </doc:doc>
669+ </arg>
670+ <doc:doc>
671+ <doc:description>
672+ <doc:para>Allows the caller to determine whether the session manager
673+ has entered the Running phase, in case the client missed the
674+ SessionRunning signal.</doc:para>
675+ </doc:description>
676+ </doc:doc>
677+ </method>
678+
679+ <!-- Signals -->
680+
681+ <signal name="ClientAdded">
682+ <arg name="id" type="o">
683+ <doc:doc>
684+ <doc:summary>The object path for the added client</doc:summary>
685+ </doc:doc>
686+ </arg>
687+ <doc:doc>
688+ <doc:description>
689+ <doc:para>Emitted when a client has been added to the session manager.
690+ </doc:para>
691+ </doc:description>
692+ </doc:doc>
693+ </signal>
694+ <signal name="ClientRemoved">
695+ <arg name="id" type="o">
696+ <doc:doc>
697+ <doc:summary>The object path for the removed client</doc:summary>
698+ </doc:doc>
699+ </arg>
700+ <doc:doc>
701+ <doc:description>
702+ <doc:para>Emitted when a client has been removed from the session manager.
703+ </doc:para>
704+ </doc:description>
705+ </doc:doc>
706+ </signal>
707+
708+ <signal name="InhibitorAdded">
709+ <arg name="id" type="o">
710+ <doc:doc>
711+ <doc:summary>The object path for the added inhibitor</doc:summary>
712+ </doc:doc>
713+ </arg>
714+ <doc:doc>
715+ <doc:description>
716+ <doc:para>Emitted when an inhibitor has been added to the session manager.
717+ </doc:para>
718+ </doc:description>
719+ </doc:doc>
720+ </signal>
721+ <signal name="InhibitorRemoved">
722+ <arg name="id" type="o">
723+ <doc:doc>
724+ <doc:summary>The object path for the removed inhibitor</doc:summary>
725+ </doc:doc>
726+ </arg>
727+ <doc:doc>
728+ <doc:description>
729+ <doc:para>Emitted when an inhibitor has been removed from the session manager.
730+ </doc:para>
731+ </doc:description>
732+ </doc:doc>
733+ </signal>
734+
735+ <signal name="SessionRunning">
736+ <doc:doc>
737+ <doc:description>
738+ <doc:para>Indicates the session has entered the Running phase.</doc:para>
739+ </doc:description>
740+ </doc:doc>
741+ </signal>
742+
743+ <signal name="SessionOver">
744+ <doc:doc>
745+ <doc:description>
746+ <doc:para>Indicates the session is about to end.</doc:para>
747+ </doc:description>
748+ </doc:doc>
749+ </signal>
750+
751+ <!-- Properties -->
752+
753+ <property name="SessionName" type="s" access="read">
754+ <doc:doc>
755+ <doc:description>
756+ <doc:para>The name of the session that has been loaded.</doc:para>
757+ </doc:description>
758+ </doc:doc>
759+ </property>
760+
761+ <property name="SessionIsActive" type="b" access="read">
762+ <doc:doc>
763+ <doc:description>
764+ <doc:para>If true, the session is currently in the
765+ foreground and available for user input.</doc:para>
766+ </doc:description>
767+ </doc:doc>
768+ </property>
769+
770+ <property name="InhibitedActions" type="u" access="read">
771+ <doc:doc>
772+ <doc:description>
773+ <doc:para>A bitmask of flags to indicate which actions
774+ are inhibited. See the Inhibit() function's description
775+ for a list of possible values.</doc:para>
776+ </doc:description>
777+ </doc:doc>
778+ </property>
779+
780+ </interface>
781+</node>
782
783=== modified file 'plugins/automount/gsd-automount-manager.c'
784--- plugins/automount/gsd-automount-manager.c 2015-06-30 15:15:52 +0000
785+++ plugins/automount/gsd-automount-manager.c 2016-05-20 17:57:13 +0000
786@@ -29,7 +29,6 @@
787 #include <gio/gio.h>
788
789 #include "gnome-settings-profile.h"
790-#include "gnome-settings-session.h"
791 #include "gsd-automount-manager.h"
792 #include "gsd-autorun.h"
793
794
795=== modified file 'plugins/background/gsd-background-manager.c'
796--- plugins/background/gsd-background-manager.c 2013-11-13 01:43:03 +0000
797+++ plugins/background/gsd-background-manager.c 2016-05-20 17:57:13 +0000
798@@ -42,7 +42,6 @@
799 #include <libgnome-desktop/gnome-bg.h>
800 #include <X11/Xatom.h>
801
802-#include "gnome-settings-session.h"
803 #include "gnome-settings-profile.h"
804 #include "gsd-background-manager.h"
805
806
807=== modified file 'plugins/color/gsd-color-manager.c'
808--- plugins/color/gsd-color-manager.c 2014-06-26 00:02:19 +0000
809+++ plugins/color/gsd-color-manager.c 2016-05-20 17:57:13 +0000
810@@ -31,7 +31,7 @@
811
812 #include "gnome-settings-plugin.h"
813 #include "gnome-settings-profile.h"
814-#include "gnome-settings-session.h"
815+#include "gnome-settings-bus.h"
816 #include "gsd-color-manager.h"
817 #include "gcm-profile-store.h"
818 #include "gcm-dmi.h"
819@@ -46,7 +46,7 @@
820
821 struct GsdColorManagerPrivate
822 {
823- GDBusProxy *session;
824+ GsdSessionManager *session;
825 CdClient *client;
826 GSettings *settings;
827 GcmProfileStore *profile_store;
828
829=== modified file 'plugins/keyboard/gsd-keyboard-manager.c'
830--- plugins/keyboard/gsd-keyboard-manager.c 2016-01-21 10:58:12 +0000
831+++ plugins/keyboard/gsd-keyboard-manager.c 2016-05-20 17:57:13 +0000
832@@ -55,7 +55,7 @@
833
834 #include <act/act.h>
835
836-#include "gnome-settings-session.h"
837+#include "gnome-settings-bus.h"
838 #include "gnome-settings-profile.h"
839 #include "gsd-keyboard-manager.h"
840 #include "gsd-input-helper.h"
841
842=== modified file 'plugins/media-keys/gsd-media-keys-manager.c'
843--- plugins/media-keys/gsd-media-keys-manager.c 2015-12-01 15:39:26 +0000
844+++ plugins/media-keys/gsd-media-keys-manager.c 2016-05-20 17:57:13 +0000
845@@ -48,7 +48,7 @@
846 #endif
847
848 #include "gnome-settings-plugin.h"
849-#include "gnome-settings-session.h"
850+#include "gnome-settings-bus.h"
851 #include "gnome-settings-profile.h"
852 #include "gsd-marshal.h"
853 #include "gsd-media-keys-manager.h"
854@@ -80,10 +80,6 @@
855 #define GNOME_KEYRING_DBUS_PATH "/org/gnome/keyring/daemon"
856 #define GNOME_KEYRING_DBUS_INTERFACE "org.gnome.keyring.Daemon"
857
858-#define GS_DBUS_NAME "org.gnome.ScreenSaver"
859-#define GS_DBUS_PATH "/org/gnome/ScreenSaver"
860-#define GS_DBUS_INTERFACE "org.gnome.ScreenSaver"
861-
862 #define SHELL_DBUS_NAME "org.gnome.Shell"
863 #define SHELL_DBUS_PATH "/org/gnome/Shell"
864
865@@ -203,6 +199,9 @@
866 GCancellable *shell_cancellable;
867 GCancellable *grab_cancellable;
868
869+ /* ScreenSaver stuff */
870+ GsdScreenSaver *screen_saver_proxy;
871+
872 /* systemd stuff */
873 GDBusProxy *logind_proxy;
874 gint inhibit_keys_fd;
875@@ -1160,7 +1159,7 @@
876 GVariant *variant;
877 GDBusProxy *proxy;
878
879- proxy = gnome_settings_session_get_session_proxy ();
880+ proxy = G_DBUS_PROXY (gnome_settings_bus_get_session_proxy ());
881 variant = g_dbus_proxy_call_sync (proxy,
882 "Shutdown",
883 NULL,
884@@ -1339,22 +1338,34 @@
885 }
886
887 static void
888+on_screen_locked (GsdScreenSaver *screen_saver,
889+ GAsyncResult *result,
890+ GsdMediaKeysManager *manager)
891+{
892+ gboolean is_locked;
893+ GError *error = NULL;
894+
895+ is_locked = gsd_screen_saver_call_lock_finish (screen_saver, result, &error);
896+
897+ if (!is_locked) {
898+ g_warning ("Couldn't lock screen: %s", error->message);
899+ g_error_free (error);
900+ return;
901+ }
902+}
903+
904+static void
905 do_lock_screensaver (GsdMediaKeysManager *manager)
906 {
907 GsdMediaKeysManagerPrivate *priv = manager->priv;
908
909- if (priv->connection == NULL) {
910- g_warning ("No existing D-Bus connection trying to handle screensaver lock key");
911- return;
912- }
913- g_dbus_connection_call (manager->priv->connection,
914- GS_DBUS_NAME,
915- GS_DBUS_PATH,
916- GS_DBUS_INTERFACE,
917- "Lock",
918- NULL, NULL,
919- G_DBUS_CALL_FLAGS_NONE, -1,
920- NULL, NULL, NULL);
921+ if (priv->screen_saver_proxy == NULL)
922+ priv->screen_saver_proxy = gnome_settings_bus_get_screen_saver_proxy ();
923+
924+ gsd_screen_saver_call_lock (priv->screen_saver_proxy,
925+ priv->cancellable,
926+ (GAsyncReadyCallback) on_screen_locked,
927+ manager);
928 }
929
930 static void
931@@ -3415,6 +3426,8 @@
932 if (media_keys_manager->priv->inhibit_keys_fd != -1)
933 close (media_keys_manager->priv->inhibit_keys_fd);
934
935+ g_clear_object (&media_keys_manager->priv->screen_saver_proxy);
936+
937 G_OBJECT_CLASS (gsd_media_keys_manager_parent_class)->finalize (object);
938 }
939
940
941=== modified file 'plugins/power/gsd-power-manager.c'
942--- plugins/power/gsd-power-manager.c 2015-10-22 09:04:20 +0000
943+++ plugins/power/gsd-power-manager.c 2016-05-20 17:57:13 +0000
944@@ -43,7 +43,7 @@
945 #include "gpm-common.h"
946 #include "gnome-settings-plugin.h"
947 #include "gnome-settings-profile.h"
948-#include "gnome-settings-session.h"
949+#include "gnome-settings-bus.h"
950 #include "gsd-enums.h"
951 #include "gsd-power-manager.h"
952 #include "gsd-rr.h"
953@@ -68,10 +68,6 @@
954 #define GSD_POWER_DBUS_INTERFACE_SCREEN GSD_POWER_DBUS_INTERFACE ".Screen"
955 #define GSD_POWER_DBUS_INTERFACE_KEYBOARD GSD_POWER_DBUS_INTERFACE ".Keyboard"
956
957-#define GS_DBUS_NAME "org.gnome.ScreenSaver"
958-#define GS_DBUS_PATH "/org/gnome/ScreenSaver"
959-#define GS_DBUS_INTERFACE "org.gnome.ScreenSaver"
960-
961 #define GSD_POWER_MANAGER_NOTIFY_TIMEOUT_SHORT 10 * 1000 /* ms */
962 #define GSD_POWER_MANAGER_NOTIFY_TIMEOUT_LONG 30 * 1000 /* ms */
963
964@@ -144,7 +140,7 @@
965 struct GsdPowerManagerPrivate
966 {
967 /* D-Bus */
968- GDBusProxy *session;
969+ GsdSessionManager *session;
970 guint name_id;
971 GDBusNodeInfo *introspection_data;
972 GDBusConnection *connection;
973@@ -153,7 +149,7 @@
974
975 /* Settings */
976 GSettings *settings;
977- GSettings *settings_session;
978+ GSettings *settings_bus;
979 GSettings *settings_screensaver;
980 GSettings *settings_xrandr;
981
982@@ -166,9 +162,7 @@
983 guint low_time;
984
985 /* Screensaver */
986- guint screensaver_watch_id;
987- GCancellable *screensaver_cancellable;
988- GDBusProxy *screensaver_proxy;
989+ GsdScreenSaver *screensaver_proxy;
990 gboolean screensaver_active;
991
992 /* State */
993@@ -246,6 +240,7 @@
994 static void idle_set_mode (GsdPowerManager *manager, GsdPowerIdleMode mode);
995 static void idle_triggered_idle_cb (GsdIdleMonitor *monitor, guint watch_id, gpointer user_data);
996 static void idle_became_active_cb (GsdIdleMonitor *monitor, guint watch_id, gpointer user_data);
997+static gboolean upower_kbd_update_brightness (GsdPowerManager *manager);
998
999 G_DEFINE_TYPE (GsdPowerManager, gsd_power_manager, G_TYPE_OBJECT)
1000
1001@@ -1739,7 +1734,7 @@
1002 static void
1003 gnome_session_shutdown (GsdPowerManager *manager)
1004 {
1005- g_dbus_proxy_call (manager->priv->session,
1006+ g_dbus_proxy_call (G_DBUS_PROXY (manager->priv->session),
1007 "Shutdown",
1008 NULL,
1009 G_DBUS_CALL_FLAGS_NONE,
1010@@ -1771,7 +1766,7 @@
1011 gnome_session_logout (GsdPowerManager *manager,
1012 guint logout_mode)
1013 {
1014- g_dbus_proxy_call (manager->priv->session,
1015+ g_dbus_proxy_call (G_DBUS_PROXY (manager->priv->session),
1016 "Logout",
1017 g_variant_new ("(u)", logout_mode),
1018 G_DBUS_CALL_FLAGS_NONE,
1019@@ -1936,6 +1931,7 @@
1020 GVariant *retval;
1021
1022 /* same as before */
1023+ upower_kbd_update_brightness (manager);
1024 if (manager->priv->kbd_brightness_now == value)
1025 return TRUE;
1026
1027@@ -1973,7 +1969,11 @@
1028 }
1029 } else {
1030 g_debug ("keyboard toggle on");
1031- /* save the current value to restore later when untoggling */
1032+ /* save the current value to restore later when untoggling,
1033+ * we force a new reading from UPower since BrightnessChanged
1034+ * signal might have not been updated, while it could have been
1035+ * changed using hardware keys or direct upower calls */
1036+ upower_kbd_update_brightness (manager);
1037 manager->priv->kbd_brightness_old = manager->priv->kbd_brightness_now;
1038 ret = upower_kbd_set_brightness (manager, 0, error);
1039 if (!ret) {
1040@@ -2057,7 +2057,7 @@
1041 }
1042
1043 if (policy == GSD_POWER_ACTION_NOTHING) {
1044- inhibit_lid_switch (manager);
1045+ inhibit_lid_switch (manager);
1046 manager->priv->inhibit_lid_switch_action = TRUE;
1047 } else {
1048 uninhibit_lid_switch (manager);
1049@@ -2088,7 +2088,7 @@
1050 do_lock = g_settings_get_boolean (manager->priv->settings_screensaver,
1051 "lock-enabled");
1052 if (!do_lock) {
1053- g_dbus_proxy_call_sync (manager->priv->screensaver_proxy,
1054+ g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->screensaver_proxy),
1055 "SetActive",
1056 g_variant_new ("(b)", TRUE),
1057 G_DBUS_CALL_FLAGS_NONE,
1058@@ -2096,7 +2096,7 @@
1059 return;
1060 }
1061
1062- g_dbus_proxy_call_sync (manager->priv->screensaver_proxy,
1063+ g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->screensaver_proxy),
1064 "Lock",
1065 NULL,
1066 G_DBUS_CALL_FLAGS_NONE,
1067@@ -2275,6 +2275,7 @@
1068 if (manager->priv->upower_kdb_proxy == NULL)
1069 return TRUE;
1070
1071+ upower_kbd_update_brightness (manager);
1072 now = manager->priv->kbd_brightness_now;
1073 max = manager->priv->kbd_brightness_max;
1074 idle = PERCENTAGE_TO_ABS (0, max, idle_percentage);
1075@@ -2299,7 +2300,7 @@
1076 GVariant *variant;
1077 gboolean is_session_active = FALSE;
1078
1079- variant = g_dbus_proxy_get_cached_property (manager->priv->session,
1080+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (manager->priv->session),
1081 "SessionIsActive");
1082 if (variant) {
1083 is_session_active = g_variant_get_boolean (variant);
1084@@ -2464,7 +2465,7 @@
1085 if (manager->priv->session == NULL)
1086 return FALSE;
1087
1088- variant = g_dbus_proxy_get_cached_property (manager->priv->session,
1089+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (manager->priv->session),
1090 "InhibitedActions");
1091 if (!variant)
1092 return FALSE;
1093@@ -2598,7 +2599,7 @@
1094 timeout_dim = SCREENSAVER_TIMEOUT_BLANK;
1095 } else {
1096 if (g_settings_get_boolean (manager->priv->settings, "idle-dim")) {
1097- timeout_dim = g_settings_get_uint (manager->priv->settings_session,
1098+ timeout_dim = g_settings_get_uint (manager->priv->settings_bus,
1099 "idle-delay");
1100 if (timeout_dim == 0) {
1101 timeout_dim = IDLE_DIM_BLANK_DISABLED_MIN;
1102@@ -2765,80 +2766,50 @@
1103 }
1104
1105 static void
1106-get_active_cb (GDBusProxy *proxy,
1107- GAsyncResult *result,
1108- GsdPowerManager *manager)
1109-{
1110- GVariant *res;
1111- GError *error = NULL;
1112-
1113- res = g_dbus_proxy_call_finish (proxy, result, &error);
1114- if (!res) {
1115- g_warning ("Failed to run GetActive() function on screensaver: %s", error->message);
1116- g_error_free (error);
1117- return;
1118- }
1119-
1120- handle_screensaver_active (manager, res);
1121- g_variant_unref (res);
1122-}
1123-
1124-static void
1125-screensaver_proxy_ready_cb (GObject *source_object,
1126- GAsyncResult *res,
1127- GsdPowerManager *manager)
1128-{
1129- GError *error = NULL;
1130- GDBusProxy *proxy;
1131-
1132- proxy = g_dbus_proxy_new_finish (res, &error);
1133-
1134- if (proxy == NULL) {
1135- if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
1136- g_warning ("Could not connect to screensaver: %s", error->message);
1137- g_error_free (error);
1138- return;
1139- }
1140-
1141- manager->priv->screensaver_proxy = proxy;
1142-
1143- g_signal_connect (manager->priv->screensaver_proxy, "g-signal",
1144- G_CALLBACK (screensaver_signal_cb), manager);
1145- g_dbus_proxy_call (manager->priv->screensaver_proxy,
1146- "GetActive",
1147- NULL,
1148- 0,
1149- G_MAXINT,
1150- NULL,
1151- (GAsyncReadyCallback)get_active_cb,
1152- manager);
1153-
1154-}
1155-
1156-static void
1157-screensaver_appeared_cb (GDBusConnection *connection,
1158- const char *name,
1159- const char *name_owner,
1160- GsdPowerManager *manager)
1161-{
1162- g_dbus_proxy_new (connection,
1163- 0,
1164- NULL,
1165- GS_DBUS_NAME,
1166- GS_DBUS_PATH,
1167- GS_DBUS_INTERFACE,
1168- manager->priv->screensaver_cancellable,
1169- (GAsyncReadyCallback) screensaver_proxy_ready_cb,
1170- manager);
1171-
1172-}
1173-
1174-static void
1175-screensaver_vanished_cb (GDBusConnection *connection,
1176- const char *name,
1177- GsdPowerManager *manager)
1178-{
1179- g_clear_object (&manager->priv->screensaver_proxy);
1180+upower_kbd_signal_cb (GDBusProxy *proxy,
1181+ const gchar *sender_name,
1182+ const gchar *signal_name,
1183+ GVariant *parameters,
1184+ gpointer user_data)
1185+{
1186+ GsdPowerManager *manager = GSD_POWER_MANAGER (user_data);
1187+
1188+ if (g_strcmp0 (signal_name, "BrightnessChanged") == 0) {
1189+ g_variant_get (parameters, "(i)", &manager->priv->kbd_brightness_now);
1190+ }
1191+}
1192+
1193+static gboolean
1194+upower_kbd_update_brightness (GsdPowerManager *manager)
1195+{
1196+ GVariant *k_now = NULL;
1197+ GError *error = NULL;
1198+ gint now;
1199+
1200+ k_now = g_dbus_proxy_call_sync (manager->priv->upower_kdb_proxy,
1201+ "GetBrightness",
1202+ NULL,
1203+ G_DBUS_CALL_FLAGS_NONE,
1204+ -1,
1205+ NULL,
1206+ &error);
1207+ if (k_now == NULL) {
1208+ if (error->domain != G_DBUS_ERROR ||
1209+ error->code != G_DBUS_ERROR_UNKNOWN_METHOD) {
1210+ g_warning ("Failed to get brightness: %s",
1211+ error->message);
1212+ }
1213+ g_error_free (error);
1214+ return FALSE;
1215+ }
1216+
1217+ g_variant_get (k_now, "(i)", &now);
1218+ g_variant_unref (k_now);
1219+
1220+ if (now >= 0)
1221+ manager->priv->kbd_brightness_now = now;
1222+
1223+ return TRUE;
1224 }
1225
1226 static void
1227@@ -2846,7 +2817,6 @@
1228 GAsyncResult *res,
1229 gpointer user_data)
1230 {
1231- GVariant *k_now = NULL;
1232 GVariant *k_max = NULL;
1233 GError *error = NULL;
1234 GsdPowerManager *manager = GSD_POWER_MANAGER (user_data);
1235@@ -2859,22 +2829,11 @@
1236 goto out;
1237 }
1238
1239- k_now = g_dbus_proxy_call_sync (manager->priv->upower_kdb_proxy,
1240- "GetBrightness",
1241- NULL,
1242- G_DBUS_CALL_FLAGS_NONE,
1243- -1,
1244- NULL,
1245- &error);
1246- if (k_now == NULL) {
1247- if (error->domain != G_DBUS_ERROR ||
1248- error->code != G_DBUS_ERROR_UNKNOWN_METHOD) {
1249- g_warning ("Failed to get brightness: %s",
1250- error->message);
1251- }
1252- g_error_free (error);
1253+ g_signal_connect (manager->priv->upower_kdb_proxy, "g-signal",
1254+ G_CALLBACK (upower_kbd_signal_cb), manager);
1255+
1256+ if (!upower_kbd_update_brightness (manager))
1257 goto out;
1258- }
1259
1260 k_max = g_dbus_proxy_call_sync (manager->priv->upower_kdb_proxy,
1261 "GetMaxBrightness",
1262@@ -2889,12 +2848,11 @@
1263 goto out;
1264 }
1265
1266- g_variant_get (k_now, "(i)", &manager->priv->kbd_brightness_now);
1267 g_variant_get (k_max, "(i)", &manager->priv->kbd_brightness_max);
1268
1269 /* set brightness to max if not currently set so is something
1270 * sensible */
1271- if (manager->priv->kbd_brightness_now <= 0) {
1272+ if (manager->priv->kbd_brightness_now < 0) {
1273 gboolean ret;
1274 ret = upower_kbd_set_brightness (manager,
1275 manager->priv->kbd_brightness_max,
1276@@ -2907,8 +2865,6 @@
1277 }
1278 }
1279 out:
1280- if (k_now != NULL)
1281- g_variant_unref (k_now);
1282 if (k_max != NULL)
1283 g_variant_unref (k_max);
1284 }
1285@@ -3304,11 +3260,16 @@
1286 inhibit_suspend (manager);
1287
1288 /* track the active session */
1289- manager->priv->session = gnome_settings_session_get_session_proxy ();
1290+ manager->priv->session = gnome_settings_bus_get_session_proxy ();
1291 g_signal_connect (manager->priv->session, "g-properties-changed",
1292 G_CALLBACK (engine_session_properties_changed_cb),
1293 manager);
1294
1295+ manager->priv->screensaver_proxy = gnome_settings_bus_get_screen_saver_proxy ();
1296+
1297+ g_signal_connect (manager->priv->screensaver_proxy, "g-signal",
1298+ G_CALLBACK (screensaver_signal_cb), manager);
1299+
1300 manager->priv->kbd_brightness_old = -1;
1301 manager->priv->kbd_brightness_pre_dim = -1;
1302 manager->priv->pre_dim_brightness = -1;
1303@@ -3316,8 +3277,8 @@
1304 g_signal_connect (manager->priv->settings, "changed",
1305 G_CALLBACK (engine_settings_key_changed_cb), manager);
1306 manager->priv->settings_screensaver = g_settings_new ("org.gnome.desktop.screensaver");
1307- manager->priv->settings_session = g_settings_new ("org.gnome.desktop.session");
1308- g_signal_connect (manager->priv->settings_session, "changed",
1309+ manager->priv->settings_bus = g_settings_new ("org.gnome.desktop.session");
1310+ g_signal_connect (manager->priv->settings_bus, "changed",
1311 G_CALLBACK (engine_settings_key_changed_cb), manager);
1312 manager->priv->settings_xrandr = g_settings_new (GSD_XRANDR_SETTINGS_SCHEMA);
1313 manager->priv->up_client = up_client_new ();
1314@@ -3355,15 +3316,6 @@
1315 session_presence_proxy_ready_cb,
1316 manager);
1317
1318- manager->priv->screensaver_watch_id =
1319- g_bus_watch_name (G_BUS_TYPE_SESSION,
1320- GS_DBUS_NAME,
1321- G_BUS_NAME_WATCHER_FLAGS_NONE,
1322- (GBusNameAppearedCallback) screensaver_appeared_cb,
1323- (GBusNameVanishedCallback) screensaver_vanished_cb,
1324- manager,
1325- NULL);
1326-
1327 manager->priv->devices_array = g_ptr_array_new_with_free_func (g_object_unref);
1328
1329 /* create a fake virtual composite battery */
1330@@ -3440,16 +3392,6 @@
1331 manager->priv->inhibit_lid_switch_timer_id = 0;
1332 }
1333
1334- if (manager->priv->screensaver_cancellable != NULL) {
1335- g_cancellable_cancel (manager->priv->screensaver_cancellable);
1336- g_clear_object (&manager->priv->screensaver_cancellable);
1337- }
1338-
1339- if (manager->priv->screensaver_watch_id != 0) {
1340- g_bus_unwatch_name (manager->priv->screensaver_watch_id);
1341- manager->priv->screensaver_watch_id = 0;
1342- }
1343-
1344 if (manager->priv->bus_cancellable != NULL) {
1345 g_cancellable_cancel (manager->priv->bus_cancellable);
1346 g_object_unref (manager->priv->bus_cancellable);
1347@@ -3466,7 +3408,7 @@
1348 g_clear_object (&manager->priv->session);
1349 g_clear_object (&manager->priv->settings);
1350 g_clear_object (&manager->priv->settings_screensaver);
1351- g_clear_object (&manager->priv->settings_session);
1352+ g_clear_object (&manager->priv->settings_bus);
1353 g_clear_object (&manager->priv->up_client);
1354
1355 if (manager->priv->inhibit_lid_switch_fd != -1) {
1356@@ -3519,7 +3461,6 @@
1357 manager->priv->inhibit_lid_switch_fd = -1;
1358 manager->priv->inhibit_suspend_fd = -1;
1359 manager->priv->inhibit_lid_switch_action = FALSE;
1360- manager->priv->screensaver_cancellable = g_cancellable_new ();
1361 manager->priv->bus_cancellable = g_cancellable_new ();
1362 }
1363
1364@@ -3538,6 +3479,7 @@
1365
1366 if (g_strcmp0 (method_name, "StepUp") == 0) {
1367 g_debug ("keyboard step up");
1368+ upower_kbd_update_brightness (manager);
1369 step = BRIGHTNESS_STEP_AMOUNT (manager->priv->kbd_brightness_max);
1370 value = MIN (manager->priv->kbd_brightness_now + step,
1371 manager->priv->kbd_brightness_max);
1372@@ -3545,12 +3487,14 @@
1373
1374 } else if (g_strcmp0 (method_name, "StepDown") == 0) {
1375 g_debug ("keyboard step down");
1376+ upower_kbd_update_brightness (manager);
1377 step = BRIGHTNESS_STEP_AMOUNT (manager->priv->kbd_brightness_max);
1378 value = MAX (manager->priv->kbd_brightness_now - step, 0);
1379 ret = upower_kbd_set_brightness (manager, value, &error);
1380
1381 } else if (g_strcmp0 (method_name, "Toggle") == 0) {
1382 ret = upower_kbd_toggle (manager, &error);
1383+ value = manager->priv->kbd_brightness_now;
1384 } else {
1385 g_assert_not_reached ();
1386 }
1387
1388=== modified file 'plugins/remote-display/gsd-remote-display-manager.c'
1389--- plugins/remote-display/gsd-remote-display-manager.c 2013-02-16 04:55:53 +0000
1390+++ plugins/remote-display/gsd-remote-display-manager.c 2016-05-20 17:57:13 +0000
1391@@ -35,7 +35,7 @@
1392 #include <gdk/gdk.h>
1393 #include <gdk/gdkx.h>
1394
1395-#include "gnome-settings-session.h"
1396+#include "gnome-settings-bus.h"
1397 #include "gnome-settings-profile.h"
1398 #include "gsd-remote-display-manager.h"
1399
1400
1401=== modified file 'plugins/screensaver-proxy/gsd-screensaver-proxy-manager.c'
1402--- plugins/screensaver-proxy/gsd-screensaver-proxy-manager.c 2013-09-03 02:41:55 +0000
1403+++ plugins/screensaver-proxy/gsd-screensaver-proxy-manager.c 2016-05-20 17:57:13 +0000
1404@@ -34,7 +34,7 @@
1405 #include <glib/gi18n.h>
1406 #include <gdk/gdk.h>
1407
1408-#include "gnome-settings-session.h"
1409+#include "gnome-settings-bus.h"
1410 #include "gnome-settings-profile.h"
1411 #include "gsd-screensaver-proxy-manager.h"
1412
1413@@ -134,7 +134,7 @@
1414
1415 struct GsdScreensaverProxyManagerPrivate
1416 {
1417- GDBusProxy *session;
1418+ GsdSessionManager *session;
1419 GDBusConnection *connection;
1420 GCancellable *bus_cancellable;
1421 GDBusNodeInfo *introspection_data;
1422@@ -169,7 +169,7 @@
1423 if (g_strcmp0 (sender, name) == 0) {
1424 guint cookie = GPOINTER_TO_UINT (cookie_ptr);
1425
1426- g_dbus_proxy_call_sync (manager->priv->session,
1427+ g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->session),
1428 "Uninhibit",
1429 g_variant_new ("(u)", cookie),
1430 G_DBUS_CALL_FLAGS_NONE,
1431@@ -213,7 +213,7 @@
1432 g_variant_get (parameters,
1433 "(ss)", &app_id, &reason);
1434
1435- ret = g_dbus_proxy_call_sync (manager->priv->session,
1436+ ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (G_DBUS_PROXY (manager->priv->session)),
1437 "Inhibit",
1438 g_variant_new ("(susu)",
1439 app_id, 0, reason, GSM_INHIBITOR_FLAG_IDLE),
1440@@ -242,7 +242,7 @@
1441 guint cookie;
1442
1443 g_variant_get (parameters, "(u)", &cookie);
1444- g_dbus_proxy_call_sync (manager->priv->session,
1445+ g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->session),
1446 "Uninhibit",
1447 parameters,
1448 G_DBUS_CALL_FLAGS_NONE,
1449@@ -353,7 +353,7 @@
1450 g_debug ("Starting screensaver-proxy manager");
1451 gnome_settings_profile_start (NULL);
1452 manager->priv->session =
1453- gnome_settings_session_get_session_proxy ();
1454+ gnome_settings_bus_get_session_proxy ();
1455 manager->priv->watch_ht = g_hash_table_new_full (g_str_hash,
1456 g_str_equal,
1457 (GDestroyNotify) g_free,
1458
1459=== modified file 'plugins/smartcard/gsd-smartcard-plugin.c'
1460--- plugins/smartcard/gsd-smartcard-plugin.c 2012-10-22 08:00:50 +0000
1461+++ plugins/smartcard/gsd-smartcard-plugin.c 2016-05-20 17:57:13 +0000
1462@@ -28,7 +28,6 @@
1463 #include <gio/gio.h>
1464
1465 #include "gnome-settings-plugin.h"
1466-#include "gnome-settings-session.h"
1467 #include "gsd-smartcard-plugin.h"
1468 #include "gsd-smartcard-manager.h"
1469
1470
1471=== modified file 'plugins/updates/gsd-updates-manager.c'
1472--- plugins/updates/gsd-updates-manager.c 2013-09-05 09:48:46 +0000
1473+++ plugins/updates/gsd-updates-manager.c 2016-05-20 17:57:13 +0000
1474@@ -35,7 +35,7 @@
1475 #include "gsd-updates-refresh.h"
1476 #include "gsd-updates-common.h"
1477 #include "gnome-settings-profile.h"
1478-#include "gnome-settings-session.h"
1479+#include "gnome-settings-bus.h"
1480
1481 #define GSD_UPDATES_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_UPDATES_MANAGER, GsdUpdatesManagerPrivate))
1482
1483@@ -60,7 +60,7 @@
1484 PkControl *control;
1485 PkTask *task;
1486 guint inhibit_cookie;
1487- GDBusProxy *proxy_session;
1488+ GsdSessionManager *proxy_session;
1489 guint update_viewer_watcher_id;
1490 GVolumeMonitor *volume_monitor;
1491 guint failed_get_updates_count;
1492@@ -975,7 +975,7 @@
1493
1494 /* TRANSLATORS: the reason why we've inhibited it */
1495 reason = _("A transaction that cannot be interrupted is running");
1496- retval = g_dbus_proxy_call_sync (manager->priv->proxy_session,
1497+ retval = g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->proxy_session),
1498 "Inhibit",
1499 g_variant_new ("(susu)",
1500 "gnome-settings-daemon", /* app-id */
1501@@ -1012,7 +1012,7 @@
1502 g_warning ("not locked");
1503 goto out;
1504 }
1505- retval = g_dbus_proxy_call_sync (manager->priv->proxy_session,
1506+ retval = g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->proxy_session),
1507 "Uninhibit",
1508 g_variant_new ("(u)",
1509 manager->priv->inhibit_cookie),
1510@@ -1328,7 +1328,7 @@
1511
1512 /* use gnome-session for the idle detection */
1513 manager->priv->proxy_session =
1514- gnome_settings_session_get_session_proxy ();
1515+ gnome_settings_bus_get_session_proxy ();
1516 if (manager->priv->proxy_session == NULL)
1517 goto out;
1518
1519
1520=== modified file 'plugins/updates/gsd-updates-refresh.c'
1521--- plugins/updates/gsd-updates-refresh.c 2013-05-28 08:37:55 +0000
1522+++ plugins/updates/gsd-updates-refresh.c 2016-05-20 17:57:13 +0000
1523@@ -25,7 +25,7 @@
1524 #include <packagekit-glib2/packagekit.h>
1525 #include <libupower-glib/upower.h>
1526
1527-#include "gnome-settings-session.h"
1528+#include "gnome-settings-bus.h"
1529
1530 #include "gsd-updates-common.h"
1531 #include "gsd-updates-refresh.h"
1532@@ -64,7 +64,7 @@
1533 guint periodic_id;
1534 UpClient *client;
1535 GSettings *settings;
1536- GDBusProxy *proxy_session;
1537+ GsdSessionManager *proxy_session;
1538 PkControl *control;
1539 };
1540
1541@@ -506,13 +506,13 @@
1542
1543 /* use gnome-session for the idle detection */
1544 refresh->priv->proxy_session =
1545- gnome_settings_session_get_session_proxy ();
1546+ gnome_settings_bus_get_session_proxy ();
1547 if (refresh->priv->proxy_session != NULL) {
1548- g_signal_connect (refresh->priv->proxy_session,
1549+ g_signal_connect (G_DBUS_PROXY (refresh->priv->proxy_session),
1550 "g-signal",
1551 G_CALLBACK (session_presence_signal_cb),
1552 refresh);
1553- status = g_dbus_proxy_get_cached_property (refresh->priv->proxy_session,
1554+ status = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (refresh->priv->proxy_session),
1555 "status");
1556 if (status) {
1557 g_variant_get (status, "u", &status_code);
1558
1559=== modified file 'plugins/xrandr/gsd-xrandr-manager.c'
1560--- plugins/xrandr/gsd-xrandr-manager.c 2015-10-07 16:07:14 +0000
1561+++ plugins/xrandr/gsd-xrandr-manager.c 2016-05-20 17:57:13 +0000
1562@@ -49,7 +49,7 @@
1563 #include "gsd-input-helper.h"
1564 #include "gnome-settings-plugin.h"
1565 #include "gnome-settings-profile.h"
1566-#include "gnome-settings-session.h"
1567+#include "gnome-settings-bus.h"
1568 #include "gsd-xrandr-manager.h"
1569 #include "gsd-rr-config.h"
1570 #include "gsd-rr.h"

Subscribers

People subscribed via source and target branches