Merge lp:~unity-settings-daemon-team/unity-settings-daemon/x-sru2 into lp:unity-settings-daemon/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
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Review via email: mp+298668@code.launchpad.net

Commit message

Releasing SRU2 for Xenial

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

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

review: Needs Fixing
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Removed as requested

Revision history for this message
Sebastien Bacher (seb128) wrote :

thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2016-06-29 15:38:15 +0000
+++ debian/changelog 2016-06-29 16:17:06 +0000
@@ -1,3 +1,33 @@
1unity-settings-daemon (15.04.1+16.04.20160209-0ubuntu3) UNRELEASED; urgency=medium
2
3 [ Robert Ancell ]
4 * Correctly check value of XDG_CURRENT_DESKTOP.
5
6 [ Marco Trevisan (Treviño) ]
7 * PowerManager: connect to keyboard BrightnessChanged signal to update
8 the cached current value properly (LP: #1510344)
9 * GsdPowerManager: don't cache kbd backlight current value (LP:
10 #1583861)
11 * common: backport g-s-d commits for having single shared dbus proxies
12 * ScreensaverProxy: redirect supported calls to gnome screensaver APIs
13 (LP: #1415265, LP: #1584161)
14
15 [ Sebastien Bacher ]
16 * Don't hit an xerror when a device is removed while being configured
17 (LP: #1503758)
18 * wacom: don't segfault when a device is removed while being
19 configured. (LP: #1439427)
20
21 [ Marco Trevisan (Treviño) ]
22 * GsdPowerManager: use proper return value for upower_kbd_toggle
23 wherever we use it (LP: #1592816)
24
25 [ Kai-Heng Feng ]
26 * SettingsManager: Queue up signals before getting D-Bus connection.
27 (LP: #1571640)
28
29 -- Robert Ancell <robert.ancell@canonical.com> Wed, 29 Jun 2016 18:16:22 +0200
30
1unity-settings-daemon (15.04.1+16.04.20160209-0ubuntu2) xenial; urgency=medium31unity-settings-daemon (15.04.1+16.04.20160209-0ubuntu2) xenial; urgency=medium
232
3 * plugins/power/gsd-power-manager.c:33 * plugins/power/gsd-power-manager.c:
434
=== modified file 'gnome-settings-daemon/Makefile.am'
--- gnome-settings-daemon/Makefile.am 2014-10-07 01:58:12 +0000
+++ gnome-settings-daemon/Makefile.am 2016-06-29 16:17:06 +0000
@@ -1,4 +1,5 @@
1NULL =1NULL =
2BUILT_SOURCES = $(NULL)
23
3INCLUDES = \4INCLUDES = \
4 -DDATADIR=\""$(datadir)"\" \5 -DDATADIR=\""$(datadir)"\" \
@@ -80,11 +81,38 @@
80 libgsd.la \81 libgsd.la \
81 $(NULL)82 $(NULL)
8283
84session_manager_dbus_built_sources = gsd-session-manager-glue.c gsd-session-manager-glue.h
85BUILT_SOURCES += $(session_manager_dbus_built_sources)
86
87$(session_manager_dbus_built_sources) : Makefile.am org.gnome.SessionManager.xml
88 gdbus-codegen \
89 --interface-prefix org.gnome.SessionManager. \
90 --generate-c-code gsd-session-manager-glue \
91 --c-namespace Gsd \
92 --annotate "org.gnome.SessionManager" \
93 "org.gtk.GDBus.C.Name" SessionManager \
94 $(srcdir)/org.gnome.SessionManager.xml
95
96screen_saver_dbus_built_sources = gsd-screen-saver-glue.c gsd-screen-saver-glue.h
97
98BUILT_SOURCES += $(screen_saver_dbus_built_sources)
99
100$(screen_saver_dbus_built_sources) : Makefile.am org.gnome.ScreenSaver.xml
101 gdbus-codegen \
102 --interface-prefix org.gnome.ScreenSaver. \
103 --generate-c-code gsd-screen-saver-glue \
104 --c-namespace Gsd \
105 --annotate "org.gnome.ScreenSaver" \
106 "org.gtk.GDBus.C.Name" ScreenSaver \
107 $(srcdir)/org.gnome.ScreenSaver.xml
108
83libgsd_la_SOURCES = \109libgsd_la_SOURCES = \
110 $(session_manager_dbus_built_sources) \
111 $(screen_saver_dbus_built_sources) \
84 gnome-settings-profile.c \112 gnome-settings-profile.c \
85 gnome-settings-profile.h \113 gnome-settings-profile.h \
86 gnome-settings-session.c \114 gnome-settings-bus.c \
87 gnome-settings-session.h \115 gnome-settings-bus.h \
88 $(NULL)116 $(NULL)
89117
90libgsd_la_CPPFLAGS = \118libgsd_la_CPPFLAGS = \
@@ -115,7 +143,10 @@
115143
116EXTRA_DIST = \144EXTRA_DIST = \
117 unity-settings-daemon-localeexec.in \145 unity-settings-daemon-localeexec.in \
118 idle-monitor.xml146 org.gnome.SessionManager.xml \
147 org.gnome.ScreenSaver.xml \
148 idle-monitor.xml \
149 $(NULL)
119150
120unity-settings-daemon-localeexec: unity-settings-daemon-localeexec.in151unity-settings-daemon-localeexec: unity-settings-daemon-localeexec.in
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 $@
122153
=== added file 'gnome-settings-daemon/gnome-settings-bus.c'
--- gnome-settings-daemon/gnome-settings-bus.c 1970-01-01 00:00:00 +0000
+++ gnome-settings-daemon/gnome-settings-bus.c 2016-06-29 16:17:06 +0000
@@ -0,0 +1,89 @@
1/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2 *
3 * Copyright (C) 2006-2011 Richard Hughes <richard@hughsie.com>
4 *
5 * Licensed under the GNU General Public License Version 2
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 */
21
22#include "config.h"
23
24#include <string.h>
25#include <unistd.h>
26#include <stdio.h>
27#include <glib.h>
28#include <gio/gio.h>
29
30#include "gnome-settings-bus.h"
31
32#define GNOME_SESSION_DBUS_NAME "org.gnome.SessionManager"
33#define GNOME_SESSION_DBUS_OBJECT "/org/gnome/SessionManager"
34
35#define GNOME_SCREENSAVER_DBUS_NAME "org.gnome.ScreenSaver"
36#define GNOME_SCREENSAVER_DBUS_OBJECT "/org/gnome/ScreenSaver"
37
38GsdSessionManager *
39gnome_settings_bus_get_session_proxy (void)
40{
41 static GsdSessionManager *session_proxy;
42 GError *error = NULL;
43
44 if (session_proxy != NULL) {
45 g_object_ref (session_proxy);
46 } else {
47 session_proxy = gsd_session_manager_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
48 G_DBUS_PROXY_FLAGS_NONE,
49 GNOME_SESSION_DBUS_NAME,
50 GNOME_SESSION_DBUS_OBJECT,
51 NULL,
52 &error);
53 if (error) {
54 g_warning ("Failed to connect to the session manager: %s", error->message);
55 g_error_free (error);
56 } else {
57 g_object_add_weak_pointer (G_OBJECT (session_proxy), (gpointer*)&session_proxy);
58 }
59 }
60
61 return session_proxy;
62}
63
64GsdScreenSaver *
65gnome_settings_bus_get_screen_saver_proxy (void)
66{
67 static GsdScreenSaver *screen_saver_proxy;
68 GError *error = NULL;
69
70 if (screen_saver_proxy != NULL) {
71 g_object_ref (screen_saver_proxy);
72 } else {
73 screen_saver_proxy = gsd_screen_saver_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
74 G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
75 G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
76 GNOME_SCREENSAVER_DBUS_NAME,
77 GNOME_SCREENSAVER_DBUS_OBJECT,
78 NULL,
79 &error);
80 if (error) {
81 g_warning ("Failed to connect to the screen saver: %s", error->message);
82 g_error_free (error);
83 } else {
84 g_object_add_weak_pointer (G_OBJECT (screen_saver_proxy), (gpointer*)&screen_saver_proxy);
85 }
86 }
87
88 return screen_saver_proxy;
89}
090
=== added file 'gnome-settings-daemon/gnome-settings-bus.h'
--- gnome-settings-daemon/gnome-settings-bus.h 1970-01-01 00:00:00 +0000
+++ gnome-settings-daemon/gnome-settings-bus.h 2016-06-29 16:17:06 +0000
@@ -0,0 +1,36 @@
1/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2 *
3 * Copyright (C) 2010-2011 Richard Hughes <richard@hughsie.com>
4 *
5 * Licensed under the GNU General Public License Version 2
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 */
21
22#ifndef __GNOME_SETTINGS_BUS_H
23#define __GNOME_SETTINGS_BUS_H
24
25#include <glib-object.h>
26#include "gsd-session-manager-glue.h"
27#include "gsd-screen-saver-glue.h"
28
29G_BEGIN_DECLS
30
31GsdSessionManager *gnome_settings_bus_get_session_proxy (void);
32GsdScreenSaver *gnome_settings_bus_get_screen_saver_proxy (void);
33
34G_END_DECLS
35
36#endif /* __GNOME_SETTINGS_BUS_H */
037
=== modified file 'gnome-settings-daemon/gnome-settings-manager.c'
--- gnome-settings-daemon/gnome-settings-manager.c 2014-06-26 00:02:19 +0000
+++ gnome-settings-daemon/gnome-settings-manager.c 2016-06-29 16:17:06 +0000
@@ -55,6 +55,11 @@
55" </interface>"55" </interface>"
56"</node>";56"</node>";
5757
58typedef struct {
59 const char *signal;
60 const char *name;
61} SignalCache;
62
58struct GnomeSettingsManagerPrivate63struct GnomeSettingsManagerPrivate
59{64{
60 guint owner_id;65 guint owner_id;
@@ -64,6 +69,7 @@
64 char **whitelist;69 char **whitelist;
65 GsdPnpIds *pnp_ids;70 GsdPnpIds *pnp_ids;
66 GSList *plugins;71 GSList *plugins;
72 GQueue *signal_queue;
67};73};
6874
69static void gnome_settings_manager_class_init (GnomeSettingsManagerClass *klass);75static void gnome_settings_manager_class_init (GnomeSettingsManagerClass *klass);
@@ -74,6 +80,17 @@
7480
75static gpointer manager_object = NULL;81static gpointer manager_object = NULL;
7682
83static void signal_cache_free (SignalCache *cache)
84{
85 if (cache == NULL) {
86 return;
87 }
88
89 g_free (cache->signal);
90 g_free (cache->name);
91 g_free (cache);
92}
93
77GQuark94GQuark
78gnome_settings_manager_error_quark (void)95gnome_settings_manager_error_quark (void)
79{96{
@@ -137,17 +154,23 @@
137 const char *name)154 const char *name)
138{155{
139 GError *error = NULL;156 GError *error = NULL;
157 GQueue *signal_queue = manager->priv->signal_queue;
140158
141 /* FIXME: maybe we should queue those up until the D-Bus159 /* Queue up signal if there's no D-Bus connection */
142 * connection is available... */160 if (manager->priv->connection == NULL) {
143 if (manager->priv->connection == NULL)161 g_debug ("Connection is null, cannot emit signal, queue instead");
162 SignalCache *cache = g_new0 (SignalCache, 1);
163 cache->signal = g_strdup (signal);
164 cache->name = g_strdup (name);
165 g_queue_push_tail (signal_queue, cache);
144 return;166 return;
167 }
145168
146 if (g_dbus_connection_emit_signal (manager->priv->connection,169 if (g_dbus_connection_emit_signal (manager->priv->connection,
147 NULL,170 NULL,
148 GSD_DBUS_PATH,171 GSD_DBUS_PATH,
149 GSD_DBUS_NAME,172 GSD_DBUS_NAME,
150 "PluginActivated",173 signal,
151 g_variant_new ("(s)", name),174 g_variant_new ("(s)", name),
152 &error) == FALSE) {175 &error) == FALSE) {
153 g_debug ("Error emitting signal: %s", error->message);176 g_debug ("Error emitting signal: %s", error->message);
@@ -344,6 +367,7 @@
344{367{
345 GDBusConnection *connection;368 GDBusConnection *connection;
346 GError *error = NULL;369 GError *error = NULL;
370 GQueue *signal_queue = manager->priv->signal_queue;
347371
348 connection = g_bus_get_finish (res, &error);372 connection = g_bus_get_finish (res, &error);
349 if (connection == NULL) {373 if (connection == NULL) {
@@ -351,6 +375,7 @@
351 g_error_free (error);375 g_error_free (error);
352 return;376 return;
353 }377 }
378
354 manager->priv->connection = connection;379 manager->priv->connection = connection;
355380
356 g_dbus_connection_register_object (connection,381 g_dbus_connection_register_object (connection,
@@ -360,6 +385,16 @@
360 NULL,385 NULL,
361 NULL,386 NULL,
362 NULL);387 NULL);
388
389 /* Emit queued up signals after got D-Bus connection */
390 if (!g_queue_is_empty (signal_queue)) {
391 g_debug ("Emit queued up signals");
392 while (!g_queue_is_empty (signal_queue)) {
393 SignalCache *cache = g_queue_pop_head (signal_queue);
394 emit_signal (manager, cache->signal, cache->name);
395 signal_cache_free (cache);
396 }
397 }
363}398}
364399
365static void400static void
@@ -396,6 +431,8 @@
396 goto out;431 goto out;
397 }432 }
398433
434 manager->priv->signal_queue = g_queue_new ();
435
399 g_debug ("loading PNPIDs");436 g_debug ("loading PNPIDs");
400 manager->priv->pnp_ids = gsd_pnp_ids_new ();437 manager->priv->pnp_ids = gsd_pnp_ids_new ();
401438
@@ -425,6 +462,12 @@
425 manager->priv->owner_id = 0;462 manager->priv->owner_id = 0;
426 }463 }
427464
465 /* This will be called from both stop_manager and dispose, so we need to
466 * prevent the queue being freed twice */
467 if (manager->priv->signal_queue != NULL) {
468 g_queue_free_full (manager->priv->signal_queue, signal_cache_free);
469 manager->priv->signal_queue = NULL;
470 }
428 g_clear_pointer (&manager->priv->whitelist, g_strfreev);471 g_clear_pointer (&manager->priv->whitelist, g_strfreev);
429 g_clear_object (&manager->priv->settings);472 g_clear_object (&manager->priv->settings);
430 g_clear_object (&manager->priv->pnp_ids);473 g_clear_object (&manager->priv->pnp_ids);
431474
=== removed file 'gnome-settings-daemon/gnome-settings-session.c'
--- gnome-settings-daemon/gnome-settings-session.c 2012-11-12 13:53:19 +0000
+++ gnome-settings-daemon/gnome-settings-session.c 1970-01-01 00:00:00 +0000
@@ -1,62 +0,0 @@
1/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2 *
3 * Copyright (C) 2006-2011 Richard Hughes <richard@hughsie.com>
4 *
5 * Licensed under the GNU General Public License Version 2
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 */
21
22#include "config.h"
23
24#include <string.h>
25#include <unistd.h>
26#include <stdio.h>
27#include <glib.h>
28#include <gio/gio.h>
29
30#include "gnome-settings-session.h"
31
32#define GNOME_SESSION_DBUS_NAME "org.gnome.SessionManager"
33#define GNOME_SESSION_DBUS_OBJECT "/org/gnome/SessionManager"
34#define GNOME_SESSION_DBUS_INTERFACE "org.gnome.SessionManager"
35
36GDBusProxy *
37gnome_settings_session_get_session_proxy (void)
38{
39 static GDBusProxy *session_proxy;
40 GError *error = NULL;
41
42 if (session_proxy != NULL) {
43 g_object_ref (session_proxy);
44 } else {
45 session_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
46 G_DBUS_PROXY_FLAGS_NONE,
47 NULL,
48 GNOME_SESSION_DBUS_NAME,
49 GNOME_SESSION_DBUS_OBJECT,
50 GNOME_SESSION_DBUS_INTERFACE,
51 NULL,
52 &error);
53 if (error) {
54 g_warning ("Failed to connect to the session manager: %s", error->message);
55 g_error_free (error);
56 } else {
57 g_object_add_weak_pointer (G_OBJECT (session_proxy), (gpointer*)&session_proxy);
58 }
59 }
60
61 return session_proxy;
62}
630
=== removed file 'gnome-settings-daemon/gnome-settings-session.h'
--- gnome-settings-daemon/gnome-settings-session.h 2012-11-12 09:12:14 +0000
+++ gnome-settings-daemon/gnome-settings-session.h 1970-01-01 00:00:00 +0000
@@ -1,34 +0,0 @@
1/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2 *
3 * Copyright (C) 2010-2011 Richard Hughes <richard@hughsie.com>
4 *
5 * Licensed under the GNU General Public License Version 2
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 */
21
22#ifndef __GNOME_SETTINGS_SESSION_H
23#define __GNOME_SETTINGS_SESSION_H
24
25#include <glib-object.h>
26
27G_BEGIN_DECLS
28
29GDBusProxy *gnome_settings_session_get_session_proxy (void);
30
31G_END_DECLS
32
33#endif /* __GNOME_SETTINGS_SESSION_H */
34
350
=== modified file 'gnome-settings-daemon/main.c'
--- gnome-settings-daemon/main.c 2014-10-07 22:07:40 +0000
+++ gnome-settings-daemon/main.c 2016-06-29 16:17:06 +0000
@@ -36,7 +36,7 @@
36#include "gnome-settings-manager.h"36#include "gnome-settings-manager.h"
37#include "gnome-settings-plugin.h"37#include "gnome-settings-plugin.h"
38#include "gnome-settings-profile.h"38#include "gnome-settings-profile.h"
39#include "gnome-settings-session.h"39#include "gnome-settings-bus.h"
40#include "gsd-idle-monitor-private.h"40#include "gsd-idle-monitor-private.h"
4141
42#define GNOME_SESSION_DBUS_NAME "org.gnome.SessionManager"42#define GNOME_SESSION_DBUS_NAME "org.gnome.SessionManager"
@@ -351,7 +351,7 @@
351{351{
352 GDBusProxy *proxy;352 GDBusProxy *proxy;
353353
354 proxy = gnome_settings_session_get_session_proxy ();354 proxy = G_DBUS_PROXY (gnome_settings_bus_get_session_proxy ());
355#ifdef HAVE_IBUS355#ifdef HAVE_IBUS
356 set_legacy_ibus_env_vars (proxy);356 set_legacy_ibus_env_vars (proxy);
357#endif357#endif
358358
=== added file 'gnome-settings-daemon/org.gnome.ScreenSaver.xml'
--- gnome-settings-daemon/org.gnome.ScreenSaver.xml 1970-01-01 00:00:00 +0000
+++ gnome-settings-daemon/org.gnome.ScreenSaver.xml 2016-06-29 16:17:06 +0000
@@ -0,0 +1,43 @@
1<!DOCTYPE node PUBLIC
2 "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
3 "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
4
5<!--
6 Copyright (C) 2013 Red Hat, Inc.
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General
19 Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
20-->
21
22<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
23 <!--
24 org.gnome.ScreenSaver:
25
26 An interface used for managing the lock screen.
27 -->
28 <interface name="org.gnome.ScreenSaver">
29 <method name="Lock" />
30 <method name="GetActive">
31 <arg name="active" direction="out" type="b" />
32 </method>
33 <method name="SetActive">
34 <arg name="value" direction="in" type="b" />
35 </method>
36 <method name="GetActiveTime">
37 <arg name="value" direction="out" type="u" />
38 </method>
39 <signal name="ActiveChanged">
40 <arg name="new_value" type="b" />
41 </signal>
42 </interface>
43</node>
044
=== added file 'gnome-settings-daemon/org.gnome.SessionManager.xml'
--- gnome-settings-daemon/org.gnome.SessionManager.xml 1970-01-01 00:00:00 +0000
+++ gnome-settings-daemon/org.gnome.SessionManager.xml 2016-06-29 16:17:06 +0000
@@ -0,0 +1,451 @@
1<?xml version="1.0" encoding="UTF-8" ?>
2<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
3<node xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
4 <interface name="org.gnome.SessionManager">
5
6 <!-- Initialization phase interfaces -->
7
8 <method name="Setenv">
9 <arg name="variable" type="s" direction="in">
10 <doc:doc>
11 <doc:summary>The variable name</doc:summary>
12 </doc:doc>
13 </arg>
14 <arg name="value" type="s" direction="in">
15 <doc:doc>
16 <doc:summary>The value</doc:summary>
17 </doc:doc>
18 </arg>
19 <doc:doc>
20 <doc:description>
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>
22 </doc:description>
23 </doc:doc>
24 </method>
25
26 <method name="GetLocale">
27 <arg name="category" type="i" direction="in">
28 <doc:doc>
29 <doc:summary>The locale category</doc:summary>
30 </doc:doc>
31 </arg>
32 <arg name="value" type="s" direction="out">
33 <doc:doc>
34 <doc:summary>The value</doc:summary>
35 </doc:doc>
36 </arg>
37 <doc:doc>
38 <doc:description>
39 <doc:para>Reads the current state of the specific locale category.</doc:para>
40 </doc:description>
41 </doc:doc>
42 </method>
43
44 <method name="InitializationError">
45 <arg name="message" type="s" direction="in">
46 <doc:doc>
47 <doc:summary>The error message</doc:summary>
48 </doc:doc>
49 </arg>
50 <arg name="fatal" type="b" direction="in">
51 <doc:doc>
52 <doc:summary>Whether the error should be treated as fatal</doc:summary>
53 </doc:doc>
54 </arg>
55 <doc:doc>
56 <doc:description>
57 <doc:para>May be used by applications launched during the Session Manager initialization phase to indicate there was a problem.</doc:para>
58 </doc:description>
59 </doc:doc>
60 </method>
61
62 <!-- Running phase interfaces -->
63
64 <method name="RegisterClient">
65 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
66 <arg type="s" name="app_id" direction="in">
67 <doc:doc>
68 <doc:summary>The application identifier</doc:summary>
69 </doc:doc>
70 </arg>
71 <arg type="s" name="client_startup_id" direction="in">
72 <doc:doc>
73 <doc:summary>Client startup identifier</doc:summary>
74 </doc:doc>
75 </arg>
76 <arg type="o" name="client_id" direction="out">
77 <doc:doc>
78 <doc:summary>The object path of the newly registered client</doc:summary>
79 </doc:doc>
80 </arg>
81 <doc:doc>
82 <doc:description>
83 <doc:para>Register the caller as a Session Management client.</doc:para>
84 </doc:description>
85 </doc:doc>
86 </method>
87
88 <method name="UnregisterClient">
89 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
90 <arg type="o" name="client_id" direction="in">
91 <doc:doc>
92 <doc:summary>The object path of the client</doc:summary>
93 </doc:doc>
94 </arg>
95 <doc:doc>
96 <doc:description>
97 <doc:para>Unregister the specified client from Session Management.</doc:para>
98 </doc:description>
99 </doc:doc>
100 </method>
101
102 <method name="Inhibit">
103 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
104 <arg type="s" name="app_id" direction="in">
105 <doc:doc>
106 <doc:summary>The application identifier</doc:summary>
107 </doc:doc>
108 </arg>
109 <arg type="u" name="toplevel_xid" direction="in">
110 <doc:doc>
111 <doc:summary>The toplevel X window identifier</doc:summary>
112 </doc:doc>
113 </arg>
114 <arg type="s" name="reason" direction="in">
115 <doc:doc>
116 <doc:summary>The reason for the inhibit</doc:summary>
117 </doc:doc>
118 </arg>
119 <arg type="u" name="flags" direction="in">
120 <doc:doc>
121 <doc:summary>Flags that specify what should be inhibited</doc:summary>
122 </doc:doc>
123 </arg>
124 <arg type="u" name="inhibit_cookie" direction="out">
125 <doc:doc>
126 <doc:summary>The cookie</doc:summary>
127 </doc:doc>
128 </arg>
129 <doc:doc>
130 <doc:summary>
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.
132 </doc:summary>
133 <doc:description>
134 <doc:para>Applications should invoke this method when they begin an operation that
135 should not be interrupted, such as creating a CD or DVD. The types of actions
136 that may be blocked are specified by the flags parameter. When the application
137 completes the operation it should call <doc:ref type="method" to="org.gnome.SessionManager.Uninhibit">Uninhibit()</doc:ref>
138 or disconnect from the session bus.
139 </doc:para>
140 <doc:para>
141 Applications should not expect that they will always be able to block the
142 action. In most cases, users will be given the option to force the action
143 to take place.
144 </doc:para>
145 <doc:para>
146 Reasons should be short and to the point.
147 </doc:para>
148 <doc:para>
149 The flags parameter must include at least one of the following:
150 <doc:list>
151 <doc:item>
152 <doc:term>1</doc:term>
153 <doc:definition>Inhibit logging out</doc:definition>
154 </doc:item>
155 <doc:item>
156 <doc:term>2</doc:term>
157 <doc:definition>Inhibit user switching</doc:definition>
158 </doc:item>
159 <doc:item>
160 <doc:term>4</doc:term>
161 <doc:definition>Inhibit suspending the session or computer</doc:definition>
162 </doc:item>
163 <doc:item>
164 <doc:term>8</doc:term>
165 <doc:definition>Inhibit the session being marked as idle</doc:definition>
166 </doc:item>
167 <doc:item>
168 <doc:term>16</doc:term>
169 <doc:definition>Inhibit auto-mounting removable media for the session</doc:definition>
170 </doc:item>
171 </doc:list>
172 Values for flags may be bitwise or'ed together.
173 </doc:para>
174 <doc:para>
175 The returned cookie is used to uniquely identify this request. It should be used
176 as an argument to <doc:ref type="method" to="org.gnome.SessionManager.Uninhibit">Uninhibit()</doc:ref> in
177 order to remove the request.
178 </doc:para>
179 </doc:description>
180 </doc:doc>
181 </method>
182
183 <method name="Uninhibit">
184 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
185 <arg type="u" name="inhibit_cookie" direction="in">
186 <doc:doc>
187 <doc:summary>The cookie</doc:summary>
188 </doc:doc>
189 </arg>
190 <doc:doc>
191 <doc:description>
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>
193 </doc:description>
194 </doc:doc>
195 </method>
196
197 <method name="IsInhibited">
198 <arg type="u" name="flags" direction="in">
199 <doc:doc>
200 <doc:summary>Flags that spefify what should be inhibited</doc:summary>
201 </doc:doc>
202 </arg>
203 <arg type="b" name="is_inhibited" direction="out">
204 <doc:doc>
205 <doc:summary>Returns TRUE if any of the operations in the bitfield flags are inhibited</doc:summary>
206 </doc:doc>
207 </arg>
208 <doc:doc>
209 <doc:description>
210 <doc:para>Determine if operation(s) specified by the flags
211 are currently inhibited. Flags are same as those accepted
212 by the
213 <doc:ref type="method" to="org.gnome.SessionManager.Inhibit">Inhibit()</doc:ref>
214 method.</doc:para>
215 </doc:description>
216 </doc:doc>
217 </method>
218
219 <method name="GetClients">
220 <arg name="clients" direction="out" type="ao">
221 <doc:doc>
222 <doc:summary>an array of client IDs</doc:summary>
223 </doc:doc>
224 </arg>
225 <doc:doc>
226 <doc:description>
227 <doc:para>This gets a list of all the <doc:ref type="interface" to="org.gnome.SessionManager.Client">Clients</doc:ref>
228 that are currently known to the session manager.</doc:para>
229 <doc:para>Each Client ID is an D-Bus object path for the object that implements the
230 <doc:ref type="interface" to="org.gnome.SessionManager.Client">Client</doc:ref> interface.</doc:para>
231 </doc:description>
232 <doc:seealso><doc:ref type="interface" to="org.gnome.SessionManager.Client">org.gnome.SessionManager.Client</doc:ref></doc:seealso>
233 </doc:doc>
234 </method>
235
236 <method name="GetInhibitors">
237 <arg name="inhibitors" direction="out" type="ao">
238 <doc:doc>
239 <doc:summary>an array of inhibitor IDs</doc:summary>
240 </doc:doc>
241 </arg>
242 <doc:doc>
243 <doc:description>
244 <doc:para>This gets a list of all the <doc:ref type="interface" to="org.gnome.SessionManager.Inhibitor">Inhibitors</doc:ref>
245 that are currently known to the session manager.</doc:para>
246 <doc:para>Each Inhibitor ID is an D-Bus object path for the object that implements the
247 <doc:ref type="interface" to="org.gnome.SessionManager.Inhibitor">Inhibitor</doc:ref> interface.</doc:para>
248 </doc:description>
249 <doc:seealso><doc:ref type="interface" to="org.gnome.SessionManager.Inhibitor">org.gnome.SessionManager.Inhibitor</doc:ref></doc:seealso>
250 </doc:doc>
251 </method>
252
253
254 <method name="IsAutostartConditionHandled">
255 <arg name="condition" direction="in" type="s">
256 <doc:doc>
257 <doc:summary>The autostart condition string</doc:summary>
258 </doc:doc>
259 </arg>
260 <arg name="handled" direction="out" type="b">
261 <doc:doc>
262 <doc:summary>True if condition is handled, false otherwise</doc:summary>
263 </doc:doc>
264 </arg>
265 <doc:doc>
266 <doc:description>
267 <doc:para>Allows the caller to determine whether the session manager is
268 handling changes to the specified autostart condition.</doc:para>
269 </doc:description>
270 </doc:doc>
271 </method>
272
273 <method name="Shutdown">
274 <doc:doc>
275 <doc:description>
276 <doc:para>Request a shutdown dialog.</doc:para>
277 </doc:description>
278 </doc:doc>
279 </method>
280
281 <method name="Reboot">
282 <doc:doc>
283 <doc:description>
284 <doc:para>Request a reboot dialog.</doc:para>
285 </doc:description>
286 </doc:doc>
287 </method>
288
289 <method name="CanShutdown">
290 <arg name="is_available" direction="out" type="b">
291 <doc:doc>
292 <doc:summary>True if shutdown is available to the user, false otherwise</doc:summary>
293 </doc:doc>
294 </arg>
295 <doc:doc>
296 <doc:description>
297 <doc:para>Allows the caller to determine whether or not it's okay to show
298 a shutdown option in the UI</doc:para>
299 </doc:description>
300 </doc:doc>
301 </method>
302
303 <method name="Logout">
304 <arg name="mode" type="u" direction="in">
305 <doc:doc>
306 <doc:summary>The type of logout that is being requested</doc:summary>
307 </doc:doc>
308 </arg>
309 <doc:doc>
310 <doc:description>
311 <doc:para>Request a logout dialog</doc:para>
312 <doc:para>
313 Allowed values for the mode parameter are:
314 <doc:list>
315 <doc:item>
316 <doc:term>0</doc:term>
317 <doc:definition>Normal.</doc:definition>
318 </doc:item>
319 <doc:item>
320 <doc:term>1</doc:term>
321 <doc:definition>No confirmation inferface should be shown.</doc:definition>
322 </doc:item>
323 <doc:item>
324 <doc:term>2</doc:term>
325 <doc:definition>Forcefully logout. No confirmation will be shown and any inhibitors will be ignored.</doc:definition>
326 </doc:item>
327 </doc:list>
328 Values for flags may be bitwise or'ed together.
329 </doc:para>
330 </doc:description>
331 </doc:doc>
332 </method>
333
334 <method name="IsSessionRunning">
335 <arg name="running" direction="out" type="b">
336 <doc:doc>
337 <doc:summary>True if the session has entered the Running phase, false otherwise</doc:summary>
338 </doc:doc>
339 </arg>
340 <doc:doc>
341 <doc:description>
342 <doc:para>Allows the caller to determine whether the session manager
343 has entered the Running phase, in case the client missed the
344 SessionRunning signal.</doc:para>
345 </doc:description>
346 </doc:doc>
347 </method>
348
349 <!-- Signals -->
350
351 <signal name="ClientAdded">
352 <arg name="id" type="o">
353 <doc:doc>
354 <doc:summary>The object path for the added client</doc:summary>
355 </doc:doc>
356 </arg>
357 <doc:doc>
358 <doc:description>
359 <doc:para>Emitted when a client has been added to the session manager.
360 </doc:para>
361 </doc:description>
362 </doc:doc>
363 </signal>
364 <signal name="ClientRemoved">
365 <arg name="id" type="o">
366 <doc:doc>
367 <doc:summary>The object path for the removed client</doc:summary>
368 </doc:doc>
369 </arg>
370 <doc:doc>
371 <doc:description>
372 <doc:para>Emitted when a client has been removed from the session manager.
373 </doc:para>
374 </doc:description>
375 </doc:doc>
376 </signal>
377
378 <signal name="InhibitorAdded">
379 <arg name="id" type="o">
380 <doc:doc>
381 <doc:summary>The object path for the added inhibitor</doc:summary>
382 </doc:doc>
383 </arg>
384 <doc:doc>
385 <doc:description>
386 <doc:para>Emitted when an inhibitor has been added to the session manager.
387 </doc:para>
388 </doc:description>
389 </doc:doc>
390 </signal>
391 <signal name="InhibitorRemoved">
392 <arg name="id" type="o">
393 <doc:doc>
394 <doc:summary>The object path for the removed inhibitor</doc:summary>
395 </doc:doc>
396 </arg>
397 <doc:doc>
398 <doc:description>
399 <doc:para>Emitted when an inhibitor has been removed from the session manager.
400 </doc:para>
401 </doc:description>
402 </doc:doc>
403 </signal>
404
405 <signal name="SessionRunning">
406 <doc:doc>
407 <doc:description>
408 <doc:para>Indicates the session has entered the Running phase.</doc:para>
409 </doc:description>
410 </doc:doc>
411 </signal>
412
413 <signal name="SessionOver">
414 <doc:doc>
415 <doc:description>
416 <doc:para>Indicates the session is about to end.</doc:para>
417 </doc:description>
418 </doc:doc>
419 </signal>
420
421 <!-- Properties -->
422
423 <property name="SessionName" type="s" access="read">
424 <doc:doc>
425 <doc:description>
426 <doc:para>The name of the session that has been loaded.</doc:para>
427 </doc:description>
428 </doc:doc>
429 </property>
430
431 <property name="SessionIsActive" type="b" access="read">
432 <doc:doc>
433 <doc:description>
434 <doc:para>If true, the session is currently in the
435 foreground and available for user input.</doc:para>
436 </doc:description>
437 </doc:doc>
438 </property>
439
440 <property name="InhibitedActions" type="u" access="read">
441 <doc:doc>
442 <doc:description>
443 <doc:para>A bitmask of flags to indicate which actions
444 are inhibited. See the Inhibit() function's description
445 for a list of possible values.</doc:para>
446 </doc:description>
447 </doc:doc>
448 </property>
449
450 </interface>
451</node>
0452
=== modified file 'plugins/automount/gsd-automount-manager.c'
--- plugins/automount/gsd-automount-manager.c 2015-06-30 15:15:52 +0000
+++ plugins/automount/gsd-automount-manager.c 2016-06-29 16:17:06 +0000
@@ -29,7 +29,7 @@
29#include <gio/gio.h>29#include <gio/gio.h>
3030
31#include "gnome-settings-profile.h"31#include "gnome-settings-profile.h"
32#include "gnome-settings-session.h"32#include "gnome-settings-bus.h"
33#include "gsd-automount-manager.h"33#include "gsd-automount-manager.h"
34#include "gsd-autorun.h"34#include "gsd-autorun.h"
3535
@@ -356,7 +356,7 @@
356static void356static void
357do_initialize_session (GsdAutomountManager *manager)357do_initialize_session (GsdAutomountManager *manager)
358{358{
359 manager->priv->session = gnome_settings_session_get_session_proxy ();359 manager->priv->session = G_DBUS_PROXY (gnome_settings_bus_get_session_proxy ());
360 g_signal_connect (manager->priv->session, "g-properties-changed",360 g_signal_connect (manager->priv->session, "g-properties-changed",
361 G_CALLBACK (session_state_changed),361 G_CALLBACK (session_state_changed),
362 manager);362 manager);
@@ -364,8 +364,6 @@
364}364}
365365
366#define SCREENSAVER_NAME "org.gnome.ScreenSaver"366#define SCREENSAVER_NAME "org.gnome.ScreenSaver"
367#define SCREENSAVER_PATH "/org/gnome/ScreenSaver"
368#define SCREENSAVER_INTERFACE "org.gnome.ScreenSaver"
369367
370static void368static void
371screensaver_signal_callback (GDBusProxy *proxy,369screensaver_signal_callback (GDBusProxy *proxy,
@@ -413,32 +411,27 @@
413}411}
414412
415static void413static void
416screensaver_proxy_ready_cb (GObject *source,414screensaver_appeared_callback (GDBusConnection *connection,
417 GAsyncResult *res,415 const gchar *name,
418 gpointer user_data)416 const gchar *name_owner,
417 gpointer user_data)
419{418{
420 GsdAutomountManager *manager = user_data;419 GsdAutomountManager *manager = user_data;
421 GError *error = NULL;420
422 GDBusProxy *ss_proxy;421 g_debug ("ScreenSaver name appeared");
423422
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 ());
425424
426 if (error != NULL) {425 if (manager->priv->ss_proxy == NULL) {
427 g_warning ("Can't get proxy for the ScreenSaver object: %s",426 g_warning ("Can't get proxy for the ScreenSaver object");
428 error->message);
429 g_error_free (error);
430
431 return;427 return;
432 }428 }
433429
434 g_debug ("ScreenSaver proxy ready");430 g_debug ("ScreenSaver proxy ready");
435431 g_signal_connect (manager->priv->ss_proxy, "g-signal",
436 manager->priv->ss_proxy = ss_proxy;
437
438 g_signal_connect (ss_proxy, "g-signal",
439 G_CALLBACK (screensaver_signal_callback), manager);432 G_CALLBACK (screensaver_signal_callback), manager);
440433
441 g_dbus_proxy_call (ss_proxy,434 g_dbus_proxy_call (manager->priv->ss_proxy,
442 "GetActive",435 "GetActive",
443 NULL,436 NULL,
444 G_DBUS_CALL_FLAGS_NO_AUTO_START,437 G_DBUS_CALL_FLAGS_NO_AUTO_START,
@@ -449,29 +442,6 @@
449}442}
450443
451static void444static void
452screensaver_appeared_callback (GDBusConnection *connection,
453 const gchar *name,
454 const gchar *name_owner,
455 gpointer user_data)
456{
457 GsdAutomountManager *manager = user_data;
458
459 g_debug ("ScreenSaver name appeared");
460
461 manager->priv->screensaver_active = FALSE;
462
463 g_dbus_proxy_new (connection,
464 G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
465 NULL,
466 name,
467 SCREENSAVER_PATH,
468 SCREENSAVER_INTERFACE,
469 NULL,
470 screensaver_proxy_ready_cb,
471 manager);
472}
473
474static void
475screensaver_vanished_callback (GDBusConnection *connection,445screensaver_vanished_callback (GDBusConnection *connection,
476 const gchar *name,446 const gchar *name,
477 gpointer user_data)447 gpointer user_data)
@@ -695,6 +665,10 @@
695665
696 g_debug ("Stopping automounting manager");666 g_debug ("Stopping automounting manager");
697667
668 if (p->ss_proxy) {
669 g_signal_handlers_disconnect_by_data (p->ss_proxy, manager);
670 }
671
698 g_clear_object (&p->session);672 g_clear_object (&p->session);
699 g_clear_object (&p->volume_monitor);673 g_clear_object (&p->volume_monitor);
700 g_clear_object (&p->settings);674 g_clear_object (&p->settings);
701675
=== modified file 'plugins/background/gsd-background-manager.c'
--- plugins/background/gsd-background-manager.c 2013-11-13 01:43:03 +0000
+++ plugins/background/gsd-background-manager.c 2016-06-29 16:17:06 +0000
@@ -42,7 +42,7 @@
42#include <libgnome-desktop/gnome-bg.h>42#include <libgnome-desktop/gnome-bg.h>
43#include <X11/Xatom.h>43#include <X11/Xatom.h>
4444
45#include "gnome-settings-session.h"45#include "gnome-settings-bus.h"
46#include "gnome-settings-profile.h"46#include "gnome-settings-profile.h"
47#include "gsd-background-manager.h"47#include "gsd-background-manager.h"
4848
@@ -335,7 +335,7 @@
335draw_background_after_session_loads (GsdBackgroundManager *manager)335draw_background_after_session_loads (GsdBackgroundManager *manager)
336{336{
337 manager->priv->proxy =337 manager->priv->proxy =
338 gnome_settings_session_get_session_proxy ();338 G_DBUS_PROXY (gnome_settings_bus_get_session_proxy ());
339339
340 manager->priv->proxy_signal_id = g_signal_connect (manager->priv->proxy,340 manager->priv->proxy_signal_id = g_signal_connect (manager->priv->proxy,
341 "g-signal",341 "g-signal",
342342
=== modified file 'plugins/color/gsd-color-manager.c'
--- plugins/color/gsd-color-manager.c 2014-06-26 00:02:19 +0000
+++ plugins/color/gsd-color-manager.c 2016-06-29 16:17:06 +0000
@@ -31,7 +31,7 @@
3131
32#include "gnome-settings-plugin.h"32#include "gnome-settings-plugin.h"
33#include "gnome-settings-profile.h"33#include "gnome-settings-profile.h"
34#include "gnome-settings-session.h"34#include "gnome-settings-bus.h"
35#include "gsd-color-manager.h"35#include "gsd-color-manager.h"
36#include "gcm-profile-store.h"36#include "gcm-profile-store.h"
37#include "gcm-dmi.h"37#include "gcm-dmi.h"
@@ -46,7 +46,7 @@
4646
47struct GsdColorManagerPrivate47struct GsdColorManagerPrivate
48{48{
49 GDBusProxy *session;49 GsdSessionManager *session;
50 CdClient *client;50 CdClient *client;
51 GSettings *settings;51 GSettings *settings;
52 GcmProfileStore *profile_store;52 GcmProfileStore *profile_store;
@@ -2142,7 +2142,7 @@
2142 priv = manager->priv = GSD_COLOR_MANAGER_GET_PRIVATE (manager);2142 priv = manager->priv = GSD_COLOR_MANAGER_GET_PRIVATE (manager);
21432143
2144 /* track the active session */2144 /* track the active session */
2145 priv->session = gnome_settings_session_get_session_proxy ();2145 priv->session = gnome_settings_bus_get_session_proxy ();
2146 g_signal_connect (priv->session, "g-properties-changed",2146 g_signal_connect (priv->session, "g-properties-changed",
2147 G_CALLBACK (gcm_session_active_changed_cb), manager);2147 G_CALLBACK (gcm_session_active_changed_cb), manager);
21482148
@@ -2196,6 +2196,8 @@
21962196
2197 manager = GSD_COLOR_MANAGER (object);2197 manager = GSD_COLOR_MANAGER (object);
21982198
2199 g_signal_handlers_disconnect_by_data (manager->priv->session, manager);
2200
2199 g_clear_object (&manager->priv->settings);2201 g_clear_object (&manager->priv->settings);
2200 g_clear_object (&manager->priv->client);2202 g_clear_object (&manager->priv->client);
2201 g_clear_object (&manager->priv->profile_store);2203 g_clear_object (&manager->priv->profile_store);
22022204
=== modified file 'plugins/common/gsd-input-helper.c'
--- plugins/common/gsd-input-helper.c 2015-10-07 16:32:40 +0000
+++ plugins/common/gsd-input-helper.c 2016-06-29 16:17:06 +0000
@@ -595,7 +595,10 @@
595 guint *value, w, h;595 guint *value, w, h;
596 int i, n_info;596 int i, n_info;
597597
598 /* ignore errors, device might be removed before config is done as in #1503758 */
599 gdk_error_trap_push();
598 info = XIQueryDevice (GDK_DISPLAY_XDISPLAY (display), deviceid, &n_info);600 info = XIQueryDevice (GDK_DISPLAY_XDISPLAY (display), deviceid, &n_info);
601 gdk_error_trap_pop_ignored ();
599 *width = *height = w = h = 0;602 *width = *height = w = h = 0;
600603
601 if (!info)604 if (!info)
602605
=== modified file 'plugins/keyboard/gsd-keyboard-manager.c'
--- plugins/keyboard/gsd-keyboard-manager.c 2016-01-21 10:58:12 +0000
+++ plugins/keyboard/gsd-keyboard-manager.c 2016-06-29 16:17:06 +0000
@@ -55,7 +55,7 @@
5555
56#include <act/act.h>56#include <act/act.h>
5757
58#include "gnome-settings-session.h"58#include "gnome-settings-bus.h"
59#include "gnome-settings-profile.h"59#include "gnome-settings-profile.h"
60#include "gsd-keyboard-manager.h"60#include "gsd-keyboard-manager.h"
61#include "gsd-input-helper.h"61#include "gsd-input-helper.h"
6262
=== modified file 'plugins/media-keys/gsd-media-keys-manager.c'
--- plugins/media-keys/gsd-media-keys-manager.c 2015-12-01 15:39:26 +0000
+++ plugins/media-keys/gsd-media-keys-manager.c 2016-06-29 16:17:06 +0000
@@ -48,7 +48,7 @@
48#endif48#endif
4949
50#include "gnome-settings-plugin.h"50#include "gnome-settings-plugin.h"
51#include "gnome-settings-session.h"51#include "gnome-settings-bus.h"
52#include "gnome-settings-profile.h"52#include "gnome-settings-profile.h"
53#include "gsd-marshal.h"53#include "gsd-marshal.h"
54#include "gsd-media-keys-manager.h"54#include "gsd-media-keys-manager.h"
@@ -80,10 +80,6 @@
80#define GNOME_KEYRING_DBUS_PATH "/org/gnome/keyring/daemon"80#define GNOME_KEYRING_DBUS_PATH "/org/gnome/keyring/daemon"
81#define GNOME_KEYRING_DBUS_INTERFACE "org.gnome.keyring.Daemon"81#define GNOME_KEYRING_DBUS_INTERFACE "org.gnome.keyring.Daemon"
8282
83#define GS_DBUS_NAME "org.gnome.ScreenSaver"
84#define GS_DBUS_PATH "/org/gnome/ScreenSaver"
85#define GS_DBUS_INTERFACE "org.gnome.ScreenSaver"
86
87#define SHELL_DBUS_NAME "org.gnome.Shell"83#define SHELL_DBUS_NAME "org.gnome.Shell"
88#define SHELL_DBUS_PATH "/org/gnome/Shell"84#define SHELL_DBUS_PATH "/org/gnome/Shell"
8985
@@ -203,6 +199,9 @@
203 GCancellable *shell_cancellable;199 GCancellable *shell_cancellable;
204 GCancellable *grab_cancellable;200 GCancellable *grab_cancellable;
205201
202 /* ScreenSaver stuff */
203 GsdScreenSaver *screen_saver_proxy;
204
206 /* systemd stuff */205 /* systemd stuff */
207 GDBusProxy *logind_proxy;206 GDBusProxy *logind_proxy;
208 gint inhibit_keys_fd;207 gint inhibit_keys_fd;
@@ -1160,7 +1159,7 @@
1160 GVariant *variant;1159 GVariant *variant;
1161 GDBusProxy *proxy;1160 GDBusProxy *proxy;
11621161
1163 proxy = gnome_settings_session_get_session_proxy ();1162 proxy = G_DBUS_PROXY (gnome_settings_bus_get_session_proxy ());
1164 variant = g_dbus_proxy_call_sync (proxy,1163 variant = g_dbus_proxy_call_sync (proxy,
1165 "Shutdown",1164 "Shutdown",
1166 NULL,1165 NULL,
@@ -1339,22 +1338,34 @@
1339}1338}
13401339
1341static void1340static void
1341on_screen_locked (GsdScreenSaver *screen_saver,
1342 GAsyncResult *result,
1343 GsdMediaKeysManager *manager)
1344{
1345 gboolean is_locked;
1346 GError *error = NULL;
1347
1348 is_locked = gsd_screen_saver_call_lock_finish (screen_saver, result, &error);
1349
1350 if (!is_locked) {
1351 g_warning ("Couldn't lock screen: %s", error->message);
1352 g_error_free (error);
1353 return;
1354 }
1355}
1356
1357static void
1342do_lock_screensaver (GsdMediaKeysManager *manager)1358do_lock_screensaver (GsdMediaKeysManager *manager)
1343{1359{
1344 GsdMediaKeysManagerPrivate *priv = manager->priv;1360 GsdMediaKeysManagerPrivate *priv = manager->priv;
13451361
1346 if (priv->connection == NULL) {1362 if (priv->screen_saver_proxy == NULL)
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 ();
1348 return;1364
1349 }1365 gsd_screen_saver_call_lock (priv->screen_saver_proxy,
1350 g_dbus_connection_call (manager->priv->connection,1366 priv->cancellable,
1351 GS_DBUS_NAME,1367 (GAsyncReadyCallback) on_screen_locked,
1352 GS_DBUS_PATH,1368 manager);
1353 GS_DBUS_INTERFACE,
1354 "Lock",
1355 NULL, NULL,
1356 G_DBUS_CALL_FLAGS_NONE, -1,
1357 NULL, NULL, NULL);
1358}1369}
13591370
1360static void1371static void
@@ -3415,6 +3426,8 @@
3415 if (media_keys_manager->priv->inhibit_keys_fd != -1)3426 if (media_keys_manager->priv->inhibit_keys_fd != -1)
3416 close (media_keys_manager->priv->inhibit_keys_fd);3427 close (media_keys_manager->priv->inhibit_keys_fd);
34173428
3429 g_clear_object (&media_keys_manager->priv->screen_saver_proxy);
3430
3418 G_OBJECT_CLASS (gsd_media_keys_manager_parent_class)->finalize (object);3431 G_OBJECT_CLASS (gsd_media_keys_manager_parent_class)->finalize (object);
3419}3432}
34203433
34213434
=== modified file 'plugins/power/gsd-power-manager.c'
--- plugins/power/gsd-power-manager.c 2016-06-29 15:38:15 +0000
+++ plugins/power/gsd-power-manager.c 2016-06-29 16:17:06 +0000
@@ -43,7 +43,7 @@
43#include "gpm-common.h"43#include "gpm-common.h"
44#include "gnome-settings-plugin.h"44#include "gnome-settings-plugin.h"
45#include "gnome-settings-profile.h"45#include "gnome-settings-profile.h"
46#include "gnome-settings-session.h"46#include "gnome-settings-bus.h"
47#include "gsd-enums.h"47#include "gsd-enums.h"
48#include "gsd-power-manager.h"48#include "gsd-power-manager.h"
49#include "gsd-rr.h"49#include "gsd-rr.h"
@@ -68,10 +68,6 @@
68#define GSD_POWER_DBUS_INTERFACE_SCREEN GSD_POWER_DBUS_INTERFACE ".Screen"68#define GSD_POWER_DBUS_INTERFACE_SCREEN GSD_POWER_DBUS_INTERFACE ".Screen"
69#define GSD_POWER_DBUS_INTERFACE_KEYBOARD GSD_POWER_DBUS_INTERFACE ".Keyboard"69#define GSD_POWER_DBUS_INTERFACE_KEYBOARD GSD_POWER_DBUS_INTERFACE ".Keyboard"
7070
71#define GS_DBUS_NAME "org.gnome.ScreenSaver"
72#define GS_DBUS_PATH "/org/gnome/ScreenSaver"
73#define GS_DBUS_INTERFACE "org.gnome.ScreenSaver"
74
75#define GSD_POWER_MANAGER_NOTIFY_TIMEOUT_SHORT 10 * 1000 /* ms */71#define GSD_POWER_MANAGER_NOTIFY_TIMEOUT_SHORT 10 * 1000 /* ms */
76#define GSD_POWER_MANAGER_NOTIFY_TIMEOUT_LONG 30 * 1000 /* ms */72#define GSD_POWER_MANAGER_NOTIFY_TIMEOUT_LONG 30 * 1000 /* ms */
7773
@@ -144,7 +140,7 @@
144struct GsdPowerManagerPrivate140struct GsdPowerManagerPrivate
145{141{
146 /* D-Bus */142 /* D-Bus */
147 GDBusProxy *session;143 GsdSessionManager *session;
148 guint name_id;144 guint name_id;
149 GDBusNodeInfo *introspection_data;145 GDBusNodeInfo *introspection_data;
150 GDBusConnection *connection;146 GDBusConnection *connection;
@@ -153,7 +149,7 @@
153149
154 /* Settings */150 /* Settings */
155 GSettings *settings;151 GSettings *settings;
156 GSettings *settings_session;152 GSettings *settings_bus;
157 GSettings *settings_screensaver;153 GSettings *settings_screensaver;
158 GSettings *settings_xrandr;154 GSettings *settings_xrandr;
159155
@@ -166,9 +162,7 @@
166 guint low_time;162 guint low_time;
167163
168 /* Screensaver */164 /* Screensaver */
169 guint screensaver_watch_id;165 GsdScreenSaver *screensaver_proxy;
170 GCancellable *screensaver_cancellable;
171 GDBusProxy *screensaver_proxy;
172 gboolean screensaver_active;166 gboolean screensaver_active;
173167
174 /* State */168 /* State */
@@ -192,7 +186,6 @@
192186
193 /* Keyboard */187 /* Keyboard */
194 GDBusProxy *upower_kdb_proxy;188 GDBusProxy *upower_kdb_proxy;
195 gint kbd_brightness_now;
196 gint kbd_brightness_max;189 gint kbd_brightness_max;
197 gint kbd_brightness_old;190 gint kbd_brightness_old;
198 gint kbd_brightness_pre_dim;191 gint kbd_brightness_pre_dim;
@@ -912,8 +905,6 @@
912 guint i;905 guint i;
913 GPtrArray *array = NULL;906 GPtrArray *array = NULL;
914 UpDevice *device;907 UpDevice *device;
915 gboolean ret;
916 GError *error = NULL;
917908
918 engine_recalculate_state (manager);909 engine_recalculate_state (manager);
919910
@@ -1739,7 +1730,7 @@
1739static void1730static void
1740gnome_session_shutdown (GsdPowerManager *manager)1731gnome_session_shutdown (GsdPowerManager *manager)
1741{1732{
1742 g_dbus_proxy_call (manager->priv->session,1733 g_dbus_proxy_call (G_DBUS_PROXY (manager->priv->session),
1743 "Shutdown",1734 "Shutdown",
1744 NULL,1735 NULL,
1745 G_DBUS_CALL_FLAGS_NONE,1736 G_DBUS_CALL_FLAGS_NONE,
@@ -1771,7 +1762,7 @@
1771gnome_session_logout (GsdPowerManager *manager,1762gnome_session_logout (GsdPowerManager *manager,
1772 guint logout_mode)1763 guint logout_mode)
1773{1764{
1774 g_dbus_proxy_call (manager->priv->session,1765 g_dbus_proxy_call (G_DBUS_PROXY (manager->priv->session),
1775 "Logout",1766 "Logout",
1776 g_variant_new ("(u)", logout_mode),1767 g_variant_new ("(u)", logout_mode),
1777 G_DBUS_CALL_FLAGS_NONE,1768 G_DBUS_CALL_FLAGS_NONE,
@@ -1931,14 +1922,41 @@
1931}1922}
19321923
1933static gboolean1924static gboolean
1925upower_kbd_get_brightness (GsdPowerManager *manager)
1926{
1927 GVariant *k_now = NULL;
1928 GError *error = NULL;
1929 gint now;
1930
1931 k_now = g_dbus_proxy_call_sync (manager->priv->upower_kdb_proxy,
1932 "GetBrightness",
1933 NULL,
1934 G_DBUS_CALL_FLAGS_NONE,
1935 -1,
1936 NULL,
1937 &error);
1938 if (k_now == NULL) {
1939 if (error->domain != G_DBUS_ERROR ||
1940 error->code != G_DBUS_ERROR_UNKNOWN_METHOD) {
1941 g_warning ("Failed to get brightness: %s",
1942 error->message);
1943 }
1944
1945 g_error_free (error);
1946 return -1;
1947 }
1948
1949 g_variant_get (k_now, "(i)", &now);
1950 g_variant_unref (k_now);
1951
1952 return now;
1953}
1954
1955static gboolean
1934upower_kbd_set_brightness (GsdPowerManager *manager, guint value, GError **error)1956upower_kbd_set_brightness (GsdPowerManager *manager, guint value, GError **error)
1935{1957{
1936 GVariant *retval;1958 GVariant *retval;
19371959
1938 /* same as before */
1939 if (manager->priv->kbd_brightness_now == value)
1940 return TRUE;
1941
1942 /* update h/w value */1960 /* update h/w value */
1943 retval = g_dbus_proxy_call_sync (manager->priv->upower_kdb_proxy,1961 retval = g_dbus_proxy_call_sync (manager->priv->upower_kdb_proxy,
1944 "SetBrightness",1962 "SetBrightness",
@@ -1950,17 +1968,16 @@
1950 if (retval == NULL)1968 if (retval == NULL)
1951 return FALSE;1969 return FALSE;
19521970
1953 /* save new value */
1954 manager->priv->kbd_brightness_now = value;
1955 g_variant_unref (retval);1971 g_variant_unref (retval);
1956 return TRUE;1972 return TRUE;
1957}1973}
19581974
1959static gboolean1975static int
1960upower_kbd_toggle (GsdPowerManager *manager,1976upower_kbd_toggle (GsdPowerManager *manager,
1961 GError **error)1977 GError **error)
1962{1978{
1963 gboolean ret;1979 gboolean ret;
1980 int value = -1;
19641981
1965 if (manager->priv->kbd_brightness_old >= 0) {1982 if (manager->priv->kbd_brightness_old >= 0) {
1966 g_debug ("keyboard toggle off");1983 g_debug ("keyboard toggle off");
@@ -1970,19 +1987,24 @@
1970 if (ret) {1987 if (ret) {
1971 /* succeeded, set to -1 since now no old value */1988 /* succeeded, set to -1 since now no old value */
1972 manager->priv->kbd_brightness_old = -1;1989 manager->priv->kbd_brightness_old = -1;
1990 value = 0;
1973 }1991 }
1974 } else {1992 } else {
1975 g_debug ("keyboard toggle on");1993 g_debug ("keyboard toggle on");
1976 /* save the current value to restore later when untoggling */1994 /* save the current value to restore later when untoggling */
1977 manager->priv->kbd_brightness_old = manager->priv->kbd_brightness_now;1995 manager->priv->kbd_brightness_old = upower_kbd_get_brightness (manager);
1978 ret = upower_kbd_set_brightness (manager, 0, error);1996 ret = upower_kbd_set_brightness (manager, 0, error);
1979 if (!ret) {1997 if (!ret) {
1980 /* failed, reset back to -1 */1998 /* failed, reset back to -1 */
1981 manager->priv->kbd_brightness_old = -1;1999 manager->priv->kbd_brightness_old = -1;
2000 } else {
2001 value = 0;
1982 }2002 }
1983 }2003 }
19842004
1985 return ret;2005 if (ret)
2006 return value;
2007 return -1;
1986}2008}
19872009
1988static gboolean2010static gboolean
@@ -2057,7 +2079,7 @@
2057 }2079 }
20582080
2059 if (policy == GSD_POWER_ACTION_NOTHING) {2081 if (policy == GSD_POWER_ACTION_NOTHING) {
2060 inhibit_lid_switch (manager);2082 inhibit_lid_switch (manager);
2061 manager->priv->inhibit_lid_switch_action = TRUE;2083 manager->priv->inhibit_lid_switch_action = TRUE;
2062 } else {2084 } else {
2063 uninhibit_lid_switch (manager);2085 uninhibit_lid_switch (manager);
@@ -2088,7 +2110,7 @@
2088 do_lock = g_settings_get_boolean (manager->priv->settings_screensaver,2110 do_lock = g_settings_get_boolean (manager->priv->settings_screensaver,
2089 "lock-enabled");2111 "lock-enabled");
2090 if (!do_lock) {2112 if (!do_lock) {
2091 g_dbus_proxy_call_sync (manager->priv->screensaver_proxy,2113 g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->screensaver_proxy),
2092 "SetActive",2114 "SetActive",
2093 g_variant_new ("(b)", TRUE),2115 g_variant_new ("(b)", TRUE),
2094 G_DBUS_CALL_FLAGS_NONE,2116 G_DBUS_CALL_FLAGS_NONE,
@@ -2096,7 +2118,7 @@
2096 return;2118 return;
2097 }2119 }
20982120
2099 g_dbus_proxy_call_sync (manager->priv->screensaver_proxy,2121 g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->screensaver_proxy),
2100 "Lock",2122 "Lock",
2101 NULL,2123 NULL,
2102 G_DBUS_CALL_FLAGS_NONE,2124 G_DBUS_CALL_FLAGS_NONE,
@@ -2275,7 +2297,7 @@
2275 if (manager->priv->upower_kdb_proxy == NULL)2297 if (manager->priv->upower_kdb_proxy == NULL)
2276 return TRUE;2298 return TRUE;
22772299
2278 now = manager->priv->kbd_brightness_now;2300 now = upower_kbd_get_brightness (manager);
2279 max = manager->priv->kbd_brightness_max;2301 max = manager->priv->kbd_brightness_max;
2280 idle = PERCENTAGE_TO_ABS (0, max, idle_percentage);2302 idle = PERCENTAGE_TO_ABS (0, max, idle_percentage);
2281 if (idle > now) {2303 if (idle > now) {
@@ -2299,7 +2321,7 @@
2299 GVariant *variant;2321 GVariant *variant;
2300 gboolean is_session_active = FALSE;2322 gboolean is_session_active = FALSE;
23012323
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),
2303 "SessionIsActive");2325 "SessionIsActive");
2304 if (variant) {2326 if (variant) {
2305 is_session_active = g_variant_get_boolean (variant);2327 is_session_active = g_variant_get_boolean (variant);
@@ -2384,8 +2406,7 @@
2384 /* only toggle keyboard if present and not already toggled */2406 /* only toggle keyboard if present and not already toggled */
2385 if (manager->priv->upower_kdb_proxy &&2407 if (manager->priv->upower_kdb_proxy &&
2386 manager->priv->kbd_brightness_old == -1) {2408 manager->priv->kbd_brightness_old == -1) {
2387 ret = upower_kbd_toggle (manager, &error);2409 if (upower_kbd_toggle (manager, &error) < 0) {
2388 if (!ret) {
2389 g_warning ("failed to turn the kbd backlight off: %s",2410 g_warning ("failed to turn the kbd backlight off: %s",
2390 error->message);2411 error->message);
2391 g_error_free (error);2412 g_error_free (error);
@@ -2427,8 +2448,7 @@
2427 /* only toggle keyboard if present and already toggled off */2448 /* only toggle keyboard if present and already toggled off */
2428 if (manager->priv->upower_kdb_proxy &&2449 if (manager->priv->upower_kdb_proxy &&
2429 manager->priv->kbd_brightness_old != -1) {2450 manager->priv->kbd_brightness_old != -1) {
2430 ret = upower_kbd_toggle (manager, &error);2451 if (upower_kbd_toggle (manager, &error) < 0) {
2431 if (!ret) {
2432 g_warning ("failed to turn the kbd backlight on: %s",2452 g_warning ("failed to turn the kbd backlight on: %s",
2433 error->message);2453 error->message);
2434 g_clear_error (&error);2454 g_clear_error (&error);
@@ -2464,7 +2484,7 @@
2464 if (manager->priv->session == NULL)2484 if (manager->priv->session == NULL)
2465 return FALSE;2485 return FALSE;
24662486
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),
2468 "InhibitedActions");2488 "InhibitedActions");
2469 if (!variant)2489 if (!variant)
2470 return FALSE;2490 return FALSE;
@@ -2598,7 +2618,7 @@
2598 timeout_dim = SCREENSAVER_TIMEOUT_BLANK;2618 timeout_dim = SCREENSAVER_TIMEOUT_BLANK;
2599 } else {2619 } else {
2600 if (g_settings_get_boolean (manager->priv->settings, "idle-dim")) {2620 if (g_settings_get_boolean (manager->priv->settings, "idle-dim")) {
2601 timeout_dim = g_settings_get_uint (manager->priv->settings_session,2621 timeout_dim = g_settings_get_uint (manager->priv->settings_bus,
2602 "idle-delay");2622 "idle-delay");
2603 if (timeout_dim == 0) {2623 if (timeout_dim == 0) {
2604 timeout_dim = IDLE_DIM_BLANK_DISABLED_MIN;2624 timeout_dim = IDLE_DIM_BLANK_DISABLED_MIN;
@@ -2765,88 +2785,10 @@
2765}2785}
27662786
2767static void2787static void
2768get_active_cb (GDBusProxy *proxy,
2769 GAsyncResult *result,
2770 GsdPowerManager *manager)
2771{
2772 GVariant *res;
2773 GError *error = NULL;
2774
2775 res = g_dbus_proxy_call_finish (proxy, result, &error);
2776 if (!res) {
2777 g_warning ("Failed to run GetActive() function on screensaver: %s", error->message);
2778 g_error_free (error);
2779 return;
2780 }
2781
2782 handle_screensaver_active (manager, res);
2783 g_variant_unref (res);
2784}
2785
2786static void
2787screensaver_proxy_ready_cb (GObject *source_object,
2788 GAsyncResult *res,
2789 GsdPowerManager *manager)
2790{
2791 GError *error = NULL;
2792 GDBusProxy *proxy;
2793
2794 proxy = g_dbus_proxy_new_finish (res, &error);
2795
2796 if (proxy == NULL) {
2797 if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
2798 g_warning ("Could not connect to screensaver: %s", error->message);
2799 g_error_free (error);
2800 return;
2801 }
2802
2803 manager->priv->screensaver_proxy = proxy;
2804
2805 g_signal_connect (manager->priv->screensaver_proxy, "g-signal",
2806 G_CALLBACK (screensaver_signal_cb), manager);
2807 g_dbus_proxy_call (manager->priv->screensaver_proxy,
2808 "GetActive",
2809 NULL,
2810 0,
2811 G_MAXINT,
2812 NULL,
2813 (GAsyncReadyCallback)get_active_cb,
2814 manager);
2815
2816}
2817
2818static void
2819screensaver_appeared_cb (GDBusConnection *connection,
2820 const char *name,
2821 const char *name_owner,
2822 GsdPowerManager *manager)
2823{
2824 g_dbus_proxy_new (connection,
2825 0,
2826 NULL,
2827 GS_DBUS_NAME,
2828 GS_DBUS_PATH,
2829 GS_DBUS_INTERFACE,
2830 manager->priv->screensaver_cancellable,
2831 (GAsyncReadyCallback) screensaver_proxy_ready_cb,
2832 manager);
2833
2834}
2835
2836static void
2837screensaver_vanished_cb (GDBusConnection *connection,
2838 const char *name,
2839 GsdPowerManager *manager)
2840{
2841 g_clear_object (&manager->priv->screensaver_proxy);
2842}
2843
2844static void
2845power_keyboard_proxy_ready_cb (GObject *source_object,2788power_keyboard_proxy_ready_cb (GObject *source_object,
2846 GAsyncResult *res,2789 GAsyncResult *res,
2847 gpointer user_data)2790 gpointer user_data)
2848{2791{
2849 GVariant *k_now = NULL;
2850 GVariant *k_max = NULL;2792 GVariant *k_max = NULL;
2851 GError *error = NULL;2793 GError *error = NULL;
2852 GsdPowerManager *manager = GSD_POWER_MANAGER (user_data);2794 GsdPowerManager *manager = GSD_POWER_MANAGER (user_data);
@@ -2859,23 +2801,6 @@
2859 goto out;2801 goto out;
2860 }2802 }
28612803
2862 k_now = g_dbus_proxy_call_sync (manager->priv->upower_kdb_proxy,
2863 "GetBrightness",
2864 NULL,
2865 G_DBUS_CALL_FLAGS_NONE,
2866 -1,
2867 NULL,
2868 &error);
2869 if (k_now == NULL) {
2870 if (error->domain != G_DBUS_ERROR ||
2871 error->code != G_DBUS_ERROR_UNKNOWN_METHOD) {
2872 g_warning ("Failed to get brightness: %s",
2873 error->message);
2874 }
2875 g_error_free (error);
2876 goto out;
2877 }
2878
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,
2880 "GetMaxBrightness",2805 "GetMaxBrightness",
2881 NULL,2806 NULL,
@@ -2884,17 +2809,20 @@
2884 NULL,2809 NULL,
2885 &error);2810 &error);
2886 if (k_max == NULL) {2811 if (k_max == NULL) {
2887 g_warning ("Failed to get max brightness: %s", error->message);2812 if (error->domain != G_DBUS_ERROR ||
2813 error->code != G_DBUS_ERROR_UNKNOWN_METHOD) {
2814 g_warning ("Failed to get max brightness: %s",
2815 error->message);
2816 }
2888 g_error_free (error);2817 g_error_free (error);
2889 goto out;2818 goto out;
2890 }2819 }
28912820
2892 g_variant_get (k_now, "(i)", &manager->priv->kbd_brightness_now);
2893 g_variant_get (k_max, "(i)", &manager->priv->kbd_brightness_max);2821 g_variant_get (k_max, "(i)", &manager->priv->kbd_brightness_max);
28942822
2895 /* set brightness to max if not currently set so is something2823 /* set brightness to max if not currently set so is something
2896 * sensible */2824 * sensible */
2897 if (manager->priv->kbd_brightness_now < 0) {2825 if (upower_kbd_get_brightness (manager) < 0) {
2898 gboolean ret;2826 gboolean ret;
2899 ret = upower_kbd_set_brightness (manager,2827 ret = upower_kbd_set_brightness (manager,
2900 manager->priv->kbd_brightness_max,2828 manager->priv->kbd_brightness_max,
@@ -2907,8 +2835,6 @@
2907 }2835 }
2908 }2836 }
2909out:2837out:
2910 if (k_now != NULL)
2911 g_variant_unref (k_now);
2912 if (k_max != NULL)2838 if (k_max != NULL)
2913 g_variant_unref (k_max);2839 g_variant_unref (k_max);
2914}2840}
@@ -3304,11 +3230,16 @@
3304 inhibit_suspend (manager);3230 inhibit_suspend (manager);
33053231
3306 /* track the active session */3232 /* track the active session */
3307 manager->priv->session = gnome_settings_session_get_session_proxy ();3233 manager->priv->session = gnome_settings_bus_get_session_proxy ();
3308 g_signal_connect (manager->priv->session, "g-properties-changed",3234 g_signal_connect (manager->priv->session, "g-properties-changed",
3309 G_CALLBACK (engine_session_properties_changed_cb),3235 G_CALLBACK (engine_session_properties_changed_cb),
3310 manager);3236 manager);
33113237
3238 manager->priv->screensaver_proxy = gnome_settings_bus_get_screen_saver_proxy ();
3239
3240 g_signal_connect (manager->priv->screensaver_proxy, "g-signal",
3241 G_CALLBACK (screensaver_signal_cb), manager);
3242
3312 manager->priv->kbd_brightness_old = -1;3243 manager->priv->kbd_brightness_old = -1;
3313 manager->priv->kbd_brightness_pre_dim = -1;3244 manager->priv->kbd_brightness_pre_dim = -1;
3314 manager->priv->pre_dim_brightness = -1;3245 manager->priv->pre_dim_brightness = -1;
@@ -3316,8 +3247,8 @@
3316 g_signal_connect (manager->priv->settings, "changed",3247 g_signal_connect (manager->priv->settings, "changed",
3317 G_CALLBACK (engine_settings_key_changed_cb), manager);3248 G_CALLBACK (engine_settings_key_changed_cb), manager);
3318 manager->priv->settings_screensaver = g_settings_new ("org.gnome.desktop.screensaver");3249 manager->priv->settings_screensaver = g_settings_new ("org.gnome.desktop.screensaver");
3319 manager->priv->settings_session = g_settings_new ("org.gnome.desktop.session");3250 manager->priv->settings_bus = g_settings_new ("org.gnome.desktop.session");
3320 g_signal_connect (manager->priv->settings_session, "changed",3251 g_signal_connect (manager->priv->settings_bus, "changed",
3321 G_CALLBACK (engine_settings_key_changed_cb), manager);3252 G_CALLBACK (engine_settings_key_changed_cb), manager);
3322 manager->priv->settings_xrandr = g_settings_new (GSD_XRANDR_SETTINGS_SCHEMA);3253 manager->priv->settings_xrandr = g_settings_new (GSD_XRANDR_SETTINGS_SCHEMA);
3323 manager->priv->up_client = up_client_new ();3254 manager->priv->up_client = up_client_new ();
@@ -3355,15 +3286,6 @@
3355 session_presence_proxy_ready_cb,3286 session_presence_proxy_ready_cb,
3356 manager);3287 manager);
33573288
3358 manager->priv->screensaver_watch_id =
3359 g_bus_watch_name (G_BUS_TYPE_SESSION,
3360 GS_DBUS_NAME,
3361 G_BUS_NAME_WATCHER_FLAGS_NONE,
3362 (GBusNameAppearedCallback) screensaver_appeared_cb,
3363 (GBusNameVanishedCallback) screensaver_vanished_cb,
3364 manager,
3365 NULL);
3366
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);
33683290
3369 /* create a fake virtual composite battery */3291 /* create a fake virtual composite battery */
@@ -3440,16 +3362,6 @@
3440 manager->priv->inhibit_lid_switch_timer_id = 0;3362 manager->priv->inhibit_lid_switch_timer_id = 0;
3441 }3363 }
34423364
3443 if (manager->priv->screensaver_cancellable != NULL) {
3444 g_cancellable_cancel (manager->priv->screensaver_cancellable);
3445 g_clear_object (&manager->priv->screensaver_cancellable);
3446 }
3447
3448 if (manager->priv->screensaver_watch_id != 0) {
3449 g_bus_unwatch_name (manager->priv->screensaver_watch_id);
3450 manager->priv->screensaver_watch_id = 0;
3451 }
3452
3453 if (manager->priv->bus_cancellable != NULL) {3365 if (manager->priv->bus_cancellable != NULL) {
3454 g_cancellable_cancel (manager->priv->bus_cancellable);3366 g_cancellable_cancel (manager->priv->bus_cancellable);
3455 g_object_unref (manager->priv->bus_cancellable);3367 g_object_unref (manager->priv->bus_cancellable);
@@ -3466,7 +3378,7 @@
3466 g_clear_object (&manager->priv->session);3378 g_clear_object (&manager->priv->session);
3467 g_clear_object (&manager->priv->settings);3379 g_clear_object (&manager->priv->settings);
3468 g_clear_object (&manager->priv->settings_screensaver);3380 g_clear_object (&manager->priv->settings_screensaver);
3469 g_clear_object (&manager->priv->settings_session);3381 g_clear_object (&manager->priv->settings_bus);
3470 g_clear_object (&manager->priv->up_client);3382 g_clear_object (&manager->priv->up_client);
34713383
3472 if (manager->priv->inhibit_lid_switch_fd != -1) {3384 if (manager->priv->inhibit_lid_switch_fd != -1) {
@@ -3519,7 +3431,6 @@
3519 manager->priv->inhibit_lid_switch_fd = -1;3431 manager->priv->inhibit_lid_switch_fd = -1;
3520 manager->priv->inhibit_suspend_fd = -1;3432 manager->priv->inhibit_suspend_fd = -1;
3521 manager->priv->inhibit_lid_switch_action = FALSE;3433 manager->priv->inhibit_lid_switch_action = FALSE;
3522 manager->priv->screensaver_cancellable = g_cancellable_new ();
3523 manager->priv->bus_cancellable = g_cancellable_new ();3434 manager->priv->bus_cancellable = g_cancellable_new ();
3524}3435}
35253436
@@ -3530,6 +3441,7 @@
3530 GVariant *parameters,3441 GVariant *parameters,
3531 GDBusMethodInvocation *invocation)3442 GDBusMethodInvocation *invocation)
3532{3443{
3444 gint now;
3533 gint step;3445 gint step;
3534 gint value = -1;3446 gint value = -1;
3535 gboolean ret;3447 gboolean ret;
@@ -3538,19 +3450,23 @@
35383450
3539 if (g_strcmp0 (method_name, "StepUp") == 0) {3451 if (g_strcmp0 (method_name, "StepUp") == 0) {
3540 g_debug ("keyboard step up");3452 g_debug ("keyboard step up");
3453 now = upower_kbd_get_brightness (manager);
3541 step = BRIGHTNESS_STEP_AMOUNT (manager->priv->kbd_brightness_max);3454 step = BRIGHTNESS_STEP_AMOUNT (manager->priv->kbd_brightness_max);
3542 value = MIN (manager->priv->kbd_brightness_now + step,3455 value = MIN (now + step,
3543 manager->priv->kbd_brightness_max);3456 manager->priv->kbd_brightness_max);
3544 ret = upower_kbd_set_brightness (manager, value, &error);3457 ret = upower_kbd_set_brightness (manager, value, &error);
35453458
3546 } else if (g_strcmp0 (method_name, "StepDown") == 0) {3459 } else if (g_strcmp0 (method_name, "StepDown") == 0) {
3547 g_debug ("keyboard step down");3460 g_debug ("keyboard step down");
3461 now = upower_kbd_get_brightness (manager);
3548 step = BRIGHTNESS_STEP_AMOUNT (manager->priv->kbd_brightness_max);3462 step = BRIGHTNESS_STEP_AMOUNT (manager->priv->kbd_brightness_max);
3549 value = MAX (manager->priv->kbd_brightness_now - step, 0);3463 value = MAX (now - step, 0);
3550 ret = upower_kbd_set_brightness (manager, value, &error);3464 ret = upower_kbd_set_brightness (manager, value, &error);
35513465
3552 } else if (g_strcmp0 (method_name, "Toggle") == 0) {3466 } else if (g_strcmp0 (method_name, "Toggle") == 0) {
3553 ret = upower_kbd_toggle (manager, &error);3467 value = upower_kbd_toggle (manager, &error);
3468 ret = (value >= 0);
3469
3554 } else {3470 } else {
3555 g_assert_not_reached ();3471 g_assert_not_reached ();
3556 }3472 }
35573473
=== modified file 'plugins/remote-display/gsd-remote-display-manager.c'
--- plugins/remote-display/gsd-remote-display-manager.c 2013-02-16 04:55:53 +0000
+++ plugins/remote-display/gsd-remote-display-manager.c 2016-06-29 16:17:06 +0000
@@ -35,7 +35,7 @@
35#include <gdk/gdk.h>35#include <gdk/gdk.h>
36#include <gdk/gdkx.h>36#include <gdk/gdkx.h>
3737
38#include "gnome-settings-session.h"38#include "gnome-settings-bus.h"
39#include "gnome-settings-profile.h"39#include "gnome-settings-profile.h"
40#include "gsd-remote-display-manager.h"40#include "gsd-remote-display-manager.h"
4141
4242
=== modified file 'plugins/screensaver-proxy/gsd-screensaver-proxy-manager.c'
--- plugins/screensaver-proxy/gsd-screensaver-proxy-manager.c 2013-09-03 02:41:55 +0000
+++ plugins/screensaver-proxy/gsd-screensaver-proxy-manager.c 2016-06-29 16:17:06 +0000
@@ -28,15 +28,12 @@
28#include <string.h>28#include <string.h>
29#include <errno.h>29#include <errno.h>
3030
31#include <locale.h>31#include <gio/gio.h>
3232
33#include <glib.h>33#include "gnome-settings-bus.h"
34#include <glib/gi18n.h>
35#include <gdk/gdk.h>
36
37#include "gnome-settings-session.h"
38#include "gnome-settings-profile.h"34#include "gnome-settings-profile.h"
39#include "gsd-screensaver-proxy-manager.h"35#include "gsd-screensaver-proxy-manager.h"
36#include "gsd-idle-monitor.h"
4037
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))
4239
@@ -134,7 +131,8 @@
134131
135struct GsdScreensaverProxyManagerPrivate132struct GsdScreensaverProxyManagerPrivate
136{133{
137 GDBusProxy *session;134 GsdSessionManager *session;
135 GsdScreenSaver *screensaver;
138 GDBusConnection *connection;136 GDBusConnection *connection;
139 GCancellable *bus_cancellable;137 GCancellable *bus_cancellable;
140 GDBusNodeInfo *introspection_data;138 GDBusNodeInfo *introspection_data;
@@ -169,7 +167,7 @@
169 if (g_strcmp0 (sender, name) == 0) {167 if (g_strcmp0 (sender, name) == 0) {
170 guint cookie = GPOINTER_TO_UINT (cookie_ptr);168 guint cookie = GPOINTER_TO_UINT (cookie_ptr);
171169
172 g_dbus_proxy_call_sync (manager->priv->session,170 g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->session),
173 "Uninhibit",171 "Uninhibit",
174 g_variant_new ("(u)", cookie),172 g_variant_new ("(u)", cookie),
175 G_DBUS_CALL_FLAGS_NONE,173 G_DBUS_CALL_FLAGS_NONE,
@@ -194,18 +192,19 @@
194 gpointer user_data)192 gpointer user_data)
195{193{
196 GsdScreensaverProxyManager *manager = GSD_SCREENSAVER_PROXY_MANAGER (user_data);194 GsdScreensaverProxyManager *manager = GSD_SCREENSAVER_PROXY_MANAGER (user_data);
195 GError *error = NULL;
196 GVariant *ret = NULL;
197197
198 /* Check session pointer as a proxy for whether the manager is in the198 /* Check session pointer as a proxy for whether the manager is in the
199 start or stop state */199 start or stop state */
200 if (manager->priv->session == NULL) {200 if (manager->priv->session == NULL || manager->priv->screensaver == NULL) {
201 return;201 goto unimplemented;
202 }202 }
203203
204 g_debug ("Calling method '%s.%s' for ScreenSaver Proxy",204 g_debug ("Calling method '%s.%s' for ScreenSaver Proxy",
205 interface_name, method_name);205 interface_name, method_name);
206206
207 if (g_strcmp0 (method_name, "Inhibit") == 0) {207 if (g_strcmp0 (method_name, "Inhibit") == 0) {
208 GVariant *ret;
209 const char *app_id;208 const char *app_id;
210 const char *reason;209 const char *reason;
211 guint cookie;210 guint cookie;
@@ -213,12 +212,12 @@
213 g_variant_get (parameters,212 g_variant_get (parameters,
214 "(ss)", &app_id, &reason);213 "(ss)", &app_id, &reason);
215214
216 ret = g_dbus_proxy_call_sync (manager->priv->session,215 ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->session),
217 "Inhibit",216 "Inhibit",
218 g_variant_new ("(susu)",217 g_variant_new ("(susu)",
219 app_id, 0, reason, GSM_INHIBITOR_FLAG_IDLE),218 app_id, 0, reason, GSM_INHIBITOR_FLAG_IDLE),
220 G_DBUS_CALL_FLAGS_NONE,219 G_DBUS_CALL_FLAGS_NONE,
221 -1, NULL, NULL);220 -1, NULL, &error);
222 g_variant_get (ret, "(u)", &cookie);221 g_variant_get (ret, "(u)", &cookie);
223 g_hash_table_insert (manager->priv->cookie_ht,222 g_hash_table_insert (manager->priv->cookie_ht,
224 GUINT_TO_POINTER (cookie),223 GUINT_TO_POINTER (cookie),
@@ -237,36 +236,52 @@
237 g_strdup (sender),236 g_strdup (sender),
238 GUINT_TO_POINTER (watch_id));237 GUINT_TO_POINTER (watch_id));
239 }238 }
240 g_dbus_method_invocation_return_value (invocation, ret);
241 } else if (g_strcmp0 (method_name, "UnInhibit") == 0) {239 } else if (g_strcmp0 (method_name, "UnInhibit") == 0) {
242 guint cookie;240 guint cookie;
243241
244 g_variant_get (parameters, "(u)", &cookie);242 g_variant_get (parameters, "(u)", &cookie);
245 g_dbus_proxy_call_sync (manager->priv->session,243 g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->session),
246 "Uninhibit",244 "Uninhibit",
247 parameters,245 parameters,
248 G_DBUS_CALL_FLAGS_NONE,246 G_DBUS_CALL_FLAGS_NONE,
249 -1, NULL, NULL);247 -1, NULL, NULL);
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);
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));
252 g_dbus_method_invocation_return_value (invocation, NULL);250 } else if (g_strcmp0 (method_name, "Lock") == 0 ||
253 } else if (g_strcmp0 (method_name, "Throttle") == 0) {251 g_strcmp0 (method_name, "SimulateUserActivity") == 0 ||
254 g_dbus_method_invocation_return_value (invocation, NULL);252 g_strcmp0 (method_name, "GetActive") == 0 ||
255 } else if (g_strcmp0 (method_name, "UnThrottle") == 0) {253 g_strcmp0 (method_name, "GetActiveTime") == 0 ||
256 g_dbus_method_invocation_return_value (invocation, NULL);254 g_strcmp0 (method_name, "SetActive") == 0) {
257 } else if (g_strcmp0 (method_name, "Lock") == 0) {255
258 goto unimplemented;256 ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->screensaver),
259 } else if (g_strcmp0 (method_name, "SimulateUserActivity") == 0) {257 method_name,
260 goto unimplemented;258 parameters,
261 } else if (g_strcmp0 (method_name, "GetActive") == 0) {259 G_DBUS_CALL_FLAGS_NONE,
262 goto unimplemented;260 -1, NULL, &error);
263 } else if (g_strcmp0 (method_name, "GetActiveTime") == 0) {261
264 goto unimplemented;262 if (error == NULL && g_strcmp0 (method_name, "SetActive") == 0) {
263 g_variant_unref (ret);
264
265 /* Returning the actual Activate state here is not possible,
266 * as calling GetActive at this point might return an invalid
267 * value if the activation process is still ongoing. */
268 ret = g_variant_ref (parameters);
269 }
265 } else if (g_strcmp0 (method_name, "GetSessionIdleTime") == 0) {270 } else if (g_strcmp0 (method_name, "GetSessionIdleTime") == 0) {
266 goto unimplemented;271 GsdIdleMonitor *idle_monitor = gsd_idle_monitor_get_core ();
267 } else if (g_strcmp0 (method_name, "SetActive") == 0) {272 gint64 idle_time_ms = gsd_idle_monitor_get_idletime (idle_monitor);
268 goto unimplemented;273 ret = g_variant_new ("(u)", idle_time_ms / 1000);
269 }274 } else {
275 goto unimplemented;
276 }
277
278 if (error != NULL) {
279 g_dbus_method_invocation_return_gerror (invocation, error);
280 g_error_free (error);
281 return;
282 }
283
284 g_dbus_method_invocation_return_value (invocation, ret);
270285
271 return;286 return;
272287
@@ -353,7 +368,9 @@
353 g_debug ("Starting screensaver-proxy manager");368 g_debug ("Starting screensaver-proxy manager");
354 gnome_settings_profile_start (NULL);369 gnome_settings_profile_start (NULL);
355 manager->priv->session =370 manager->priv->session =
356 gnome_settings_session_get_session_proxy ();371 gnome_settings_bus_get_session_proxy ();
372 manager->priv->screensaver =
373 gnome_settings_bus_get_screen_saver_proxy ();
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,
358 g_str_equal,375 g_str_equal,
359 (GDestroyNotify) g_free,376 (GDestroyNotify) g_free,
@@ -371,6 +388,7 @@
371{388{
372 g_debug ("Stopping screensaver_proxy manager");389 g_debug ("Stopping screensaver_proxy manager");
373 g_clear_object (&manager->priv->session);390 g_clear_object (&manager->priv->session);
391 g_clear_object (&manager->priv->screensaver);
374 g_clear_pointer (&manager->priv->watch_ht, g_hash_table_destroy);392 g_clear_pointer (&manager->priv->watch_ht, g_hash_table_destroy);
375 g_clear_pointer (&manager->priv->cookie_ht, g_hash_table_destroy);393 g_clear_pointer (&manager->priv->cookie_ht, g_hash_table_destroy);
376}394}
@@ -403,6 +421,8 @@
403421
404 g_return_if_fail (manager->priv != NULL);422 g_return_if_fail (manager->priv != NULL);
405423
424 gsd_screensaver_proxy_manager_stop (manager);
425
406 if (manager->priv->name_id != 0) {426 if (manager->priv->name_id != 0) {
407 g_bus_unown_name (manager->priv->name_id);427 g_bus_unown_name (manager->priv->name_id);
408 manager->priv->name_id = 0;428 manager->priv->name_id = 0;
409429
=== modified file 'plugins/smartcard/gsd-smartcard-plugin.c'
--- plugins/smartcard/gsd-smartcard-plugin.c 2012-10-22 08:00:50 +0000
+++ plugins/smartcard/gsd-smartcard-plugin.c 2016-06-29 16:17:06 +0000
@@ -28,13 +28,12 @@
28#include <gio/gio.h>28#include <gio/gio.h>
2929
30#include "gnome-settings-plugin.h"30#include "gnome-settings-plugin.h"
31#include "gnome-settings-session.h"31#include "gnome-settings-bus.h"
32#include "gsd-smartcard-plugin.h"32#include "gsd-smartcard-plugin.h"
33#include "gsd-smartcard-manager.h"33#include "gsd-smartcard-manager.h"
3434
35struct GsdSmartcardPluginPrivate {35struct GsdSmartcardPluginPrivate {
36 GsdSmartcardManager *manager;36 GsdSmartcardManager *manager;
37 GDBusConnection *bus_connection;
3837
39 guint32 is_active : 1;38 guint32 is_active : 1;
40};39};
@@ -46,10 +45,6 @@
46 GSD_SMARTCARD_REMOVE_ACTION_FORCE_LOGOUT,45 GSD_SMARTCARD_REMOVE_ACTION_FORCE_LOGOUT,
47} GsdSmartcardRemoveAction;46} GsdSmartcardRemoveAction;
4847
49#define SCREENSAVER_DBUS_NAME "org.gnome.ScreenSaver"
50#define SCREENSAVER_DBUS_PATH "/"
51#define SCREENSAVER_DBUS_INTERFACE "org.gnome.ScreenSaver"
52
53#define SM_LOGOUT_MODE_FORCE 248#define SM_LOGOUT_MODE_FORCE 2
5449
55#define KEY_REMOVE_ACTION "removal-action"50#define KEY_REMOVE_ACTION "removal-action"
@@ -61,20 +56,13 @@
61static void56static void
62simulate_user_activity (GsdSmartcardPlugin *plugin)57simulate_user_activity (GsdSmartcardPlugin *plugin)
63{58{
59 GsdScreenSaver *screensaver_proxy;
64 GDBusProxy *screensaver_proxy;60 GDBusProxy *screensaver_proxy;
6561
66 g_debug ("GsdSmartcardPlugin telling screensaver about smart card insertion");62 g_debug ("GsdSmartcardPlugin telling screensaver about smart card insertion");
67 screensaver_proxy = g_dbus_proxy_new_sync (plugin->priv->bus_connection,63 screensaver_proxy = gnome_settings_bus_get_screen_saver_proxy ();
68 0, NULL,64 gsd_screen_saver_call_simulate_user_activity_sync (screensaver_proxy,
69 SCREENSAVER_DBUS_NAME,65 NULL, NULL);
70 SCREENSAVER_DBUS_PATH,
71 SCREENSAVER_DBUS_INTERFACE,
72 NULL, NULL);
73
74 g_dbus_proxy_call (screensaver_proxy,
75 "SimulateUserActivity",
76 NULL, G_DBUS_CALL_FLAGS_NONE,
77 -1, NULL, NULL, NULL);
7866
79 g_object_unref (screensaver_proxy);67 g_object_unref (screensaver_proxy);
80}68}
@@ -85,17 +73,8 @@
85 GDBusProxy *screensaver_proxy;73 GDBusProxy *screensaver_proxy;
8674
87 g_debug ("GsdSmartcardPlugin telling screensaver to lock screen");75 g_debug ("GsdSmartcardPlugin telling screensaver to lock screen");
88 screensaver_proxy = g_dbus_proxy_new_sync (plugin->priv->bus_connection,76 screensaver_proxy = gnome_settings_bus_get_screen_saver_proxy ();
89 0, NULL,77 gsd_screen_saver_call_lock_sync (screensaver_proxy, NULL, NULL);
90 SCREENSAVER_DBUS_NAME,
91 SCREENSAVER_DBUS_PATH,
92 SCREENSAVER_DBUS_INTERFACE,
93 NULL, NULL);
94
95 g_dbus_proxy_call (screensaver_proxy,
96 "Lock",
97 NULL, G_DBUS_CALL_FLAGS_NONE,
98 -1, NULL, NULL, NULL);
9978
100 g_object_unref (screensaver_proxy);79 g_object_unref (screensaver_proxy);
101}80}
@@ -108,7 +87,7 @@
108 GVariant *res;87 GVariant *res;
10988
110 g_debug ("GsdSmartcardPlugin telling session manager to force logout");89 g_debug ("GsdSmartcardPlugin telling session manager to force logout");
111 sm_proxy = gnome_settings_session_get_session_proxy ();90 sm_proxy = gnome_settings_bus_get_session_proxy ();
11291
113 error = NULL;92 error = NULL;
114 res = g_dbus_proxy_call_sync (sm_proxy,93 res = g_dbus_proxy_call_sync (sm_proxy,
@@ -269,13 +248,6 @@
269 g_debug ("GsdSmartcardPlugin Activating smartcard plugin");248 g_debug ("GsdSmartcardPlugin Activating smartcard plugin");
270249
271 error = NULL;250 error = NULL;
272 smartcard_plugin->priv->bus_connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
273
274 if (smartcard_plugin->priv->bus_connection == NULL) {
275 g_warning ("GsdSmartcardPlugin Unable to connect to session bus: %s", error->message);
276 return;
277 }
278
279 if (!gsd_smartcard_manager_start (smartcard_plugin->priv->manager, &error)) {251 if (!gsd_smartcard_manager_start (smartcard_plugin->priv->manager, &error)) {
280 g_warning ("GsdSmartcardPlugin Unable to start smartcard manager: %s", error->message);252 g_warning ("GsdSmartcardPlugin Unable to start smartcard manager: %s", error->message);
281 g_error_free (error);253 g_error_free (error);
@@ -318,7 +290,6 @@
318290
319 g_signal_handlers_disconnect_by_func (smartcard_plugin->priv->manager,291 g_signal_handlers_disconnect_by_func (smartcard_plugin->priv->manager,
320 smartcard_inserted_cb, smartcard_plugin);292 smartcard_inserted_cb, smartcard_plugin);
321 smartcard_plugin->priv->bus_connection = NULL;
322 smartcard_plugin->priv->is_active = FALSE;293 smartcard_plugin->priv->is_active = FALSE;
323}294}
324295
325296
=== modified file 'plugins/updates/gsd-updates-manager.c'
--- plugins/updates/gsd-updates-manager.c 2013-09-05 09:48:46 +0000
+++ plugins/updates/gsd-updates-manager.c 2016-06-29 16:17:06 +0000
@@ -35,7 +35,7 @@
35#include "gsd-updates-refresh.h"35#include "gsd-updates-refresh.h"
36#include "gsd-updates-common.h"36#include "gsd-updates-common.h"
37#include "gnome-settings-profile.h"37#include "gnome-settings-profile.h"
38#include "gnome-settings-session.h"38#include "gnome-settings-bus.h"
3939
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))
4141
@@ -60,7 +60,7 @@
60 PkControl *control;60 PkControl *control;
61 PkTask *task;61 PkTask *task;
62 guint inhibit_cookie;62 guint inhibit_cookie;
63 GDBusProxy *proxy_session;63 GsdSessionManager *proxy_session;
64 guint update_viewer_watcher_id;64 guint update_viewer_watcher_id;
65 GVolumeMonitor *volume_monitor;65 GVolumeMonitor *volume_monitor;
66 guint failed_get_updates_count;66 guint failed_get_updates_count;
@@ -975,7 +975,7 @@
975975
976 /* TRANSLATORS: the reason why we've inhibited it */976 /* TRANSLATORS: the reason why we've inhibited it */
977 reason = _("A transaction that cannot be interrupted is running");977 reason = _("A transaction that cannot be interrupted is running");
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),
979 "Inhibit",979 "Inhibit",
980 g_variant_new ("(susu)",980 g_variant_new ("(susu)",
981 "gnome-settings-daemon", /* app-id */981 "gnome-settings-daemon", /* app-id */
@@ -1012,7 +1012,7 @@
1012 g_warning ("not locked");1012 g_warning ("not locked");
1013 goto out;1013 goto out;
1014 }1014 }
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),
1016 "Uninhibit",1016 "Uninhibit",
1017 g_variant_new ("(u)",1017 g_variant_new ("(u)",
1018 manager->priv->inhibit_cookie),1018 manager->priv->inhibit_cookie),
@@ -1328,7 +1328,7 @@
13281328
1329 /* use gnome-session for the idle detection */1329 /* use gnome-session for the idle detection */
1330 manager->priv->proxy_session =1330 manager->priv->proxy_session =
1331 gnome_settings_session_get_session_proxy ();1331 gnome_settings_bus_get_session_proxy ();
1332 if (manager->priv->proxy_session == NULL)1332 if (manager->priv->proxy_session == NULL)
1333 goto out;1333 goto out;
13341334
13351335
=== modified file 'plugins/updates/gsd-updates-refresh.c'
--- plugins/updates/gsd-updates-refresh.c 2013-05-28 08:37:55 +0000
+++ plugins/updates/gsd-updates-refresh.c 2016-06-29 16:17:06 +0000
@@ -25,7 +25,7 @@
25#include <packagekit-glib2/packagekit.h>25#include <packagekit-glib2/packagekit.h>
26#include <libupower-glib/upower.h>26#include <libupower-glib/upower.h>
2727
28#include "gnome-settings-session.h"28#include "gnome-settings-bus.h"
2929
30#include "gsd-updates-common.h"30#include "gsd-updates-common.h"
31#include "gsd-updates-refresh.h"31#include "gsd-updates-refresh.h"
@@ -64,7 +64,7 @@
64 guint periodic_id;64 guint periodic_id;
65 UpClient *client;65 UpClient *client;
66 GSettings *settings;66 GSettings *settings;
67 GDBusProxy *proxy_session;67 GsdSessionManager *proxy_session;
68 PkControl *control;68 PkControl *control;
69};69};
7070
@@ -506,13 +506,13 @@
506506
507 /* use gnome-session for the idle detection */507 /* use gnome-session for the idle detection */
508 refresh->priv->proxy_session =508 refresh->priv->proxy_session =
509 gnome_settings_session_get_session_proxy ();509 gnome_settings_bus_get_session_proxy ();
510 if (refresh->priv->proxy_session != NULL) {510 if (refresh->priv->proxy_session != NULL) {
511 g_signal_connect (refresh->priv->proxy_session,511 g_signal_connect (G_DBUS_PROXY (refresh->priv->proxy_session),
512 "g-signal",512 "g-signal",
513 G_CALLBACK (session_presence_signal_cb),513 G_CALLBACK (session_presence_signal_cb),
514 refresh);514 refresh);
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),
516 "status");516 "status");
517 if (status) {517 if (status) {
518 g_variant_get (status, "u", &status_code);518 g_variant_get (status, "u", &status_code);
519519
=== modified file 'plugins/wacom/gsd-wacom-manager.c'
--- plugins/wacom/gsd-wacom-manager.c 2015-10-22 10:52:11 +0000
+++ plugins/wacom/gsd-wacom-manager.c 2016-06-29 16:17:06 +0000
@@ -167,6 +167,8 @@
167 XDevice *xdev;167 XDevice *xdev;
168168
169 xdev = open_device (device);169 xdev = open_device (device);
170 if (xdev == NULL)
171 return;
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);
171 xdevice_close (xdev);173 xdevice_close (xdev);
172}174}
@@ -310,6 +312,8 @@
310 XDevice *xdev;312 XDevice *xdev;
311313
312 xdev = open_device (device);314 xdev = open_device (device);
315 if (xdev == NULL)
316 return;
313 gdk_error_trap_push ();317 gdk_error_trap_push ();
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);
315 if (gdk_error_trap_pop ())319 if (gdk_error_trap_pop ())
@@ -438,6 +442,8 @@
438 int i, j, rc;442 int i, j, rc;
439443
440 xdev = open_device (device);444 xdev = open_device (device);
445 if (xdev == NULL)
446 return;
441447
442 intmap = g_variant_get_fixed_array (value, &nmap, sizeof (gint32));448 intmap = g_variant_get_fixed_array (value, &nmap, sizeof (gint32));
443 map = g_new0 (unsigned char, nmap);449 map = g_new0 (unsigned char, nmap);
@@ -661,6 +667,8 @@
661667
662 /* Normal buttons */668 /* Normal buttons */
663 xdev = open_device (device);669 xdev = open_device (device);
670 if (xdev == NULL)
671 return;
664672
665 gdk_error_trap_push ();673 gdk_error_trap_push ();
666674
667675
=== modified file 'plugins/xrandr/gsd-xrandr-manager.c'
--- plugins/xrandr/gsd-xrandr-manager.c 2015-10-07 16:07:14 +0000
+++ plugins/xrandr/gsd-xrandr-manager.c 2016-06-29 16:17:06 +0000
@@ -49,7 +49,7 @@
49#include "gsd-input-helper.h"49#include "gsd-input-helper.h"
50#include "gnome-settings-plugin.h"50#include "gnome-settings-plugin.h"
51#include "gnome-settings-profile.h"51#include "gnome-settings-profile.h"
52#include "gnome-settings-session.h"52#include "gnome-settings-bus.h"
53#include "gsd-xrandr-manager.h"53#include "gsd-xrandr-manager.h"
54#include "gsd-rr-config.h"54#include "gsd-rr-config.h"
55#include "gsd-rr.h"55#include "gsd-rr.h"
5656
=== modified file 'plugins/xsettings/gsd-xsettings-manager.c'
--- plugins/xsettings/gsd-xsettings-manager.c 2016-02-09 09:56:17 +0000
+++ plugins/xsettings/gsd-xsettings-manager.c 2016-06-29 16:17:06 +0000
@@ -434,6 +434,29 @@
434 return dpi * factor;434 return dpi * factor;
435}435}
436436
437static gboolean
438in_desktop (const gchar *name)
439{
440 const gchar *desktop_name_list;
441 gchar **names;
442 gboolean in_list = FALSE;
443 gint i;
444
445 desktop_name_list = g_getenv ("XDG_CURRENT_DESKTOP");
446 if (!desktop_name_list)
447 return FALSE;
448
449 names = g_strsplit (desktop_name_list, ":", -1);
450 for (i = 0; names[i] && !in_list; i++)
451 if (strcmp (names[i], name) == 0) {
452 in_list = TRUE;
453 break;
454 }
455 g_strfreev (names);
456
457 return in_list;
458}
459
437static int460static int
438get_window_scale (GnomeXSettingsManager *manager)461get_window_scale (GnomeXSettingsManager *manager)
439{462{
@@ -453,7 +476,7 @@
453 window_scale = 1;476 window_scale = 1;
454477
455 /* Under Unity let the shell handle the scaling */478 /* Under Unity let the shell handle the scaling */
456 if (g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0)479 if (in_desktop ("Unity"))
457 goto out;480 goto out;
458481
459 display = gdk_display_get_default ();482 display = gdk_display_get_default ();

Subscribers

People subscribed via source and target branches