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