on xenial help sign in
Proxy inactivity timeout values from gsettings into Unity.Screen Fixes: 1230345

Approved by: Daniel d'Andrada, PS Jenkins bot

commit1a3ac0d9f5cbbfaae680ad7301efee8b1a2f3d0a authorAlberto Aguirre <alberto.aguirre@canonical.com> dateFri 22 Aug 2014, 09:27 (12 years ago) parenta8c676078daf45
2 files changed+17−1
debian/control+1−1 plugins/Powerd/Powerd.cpp+16
debian/control+1−1
@@ -168,7 +168,7 @@ Architecture: any
168168Multi-Arch: same
169169Pre-Depends: ${misc:Pre-Depends},
170170Depends: accountsservice-ubuntu-schemas,
171− gsettings-ubuntu-schemas,
171+ gsettings-ubuntu-schemas (>= 0.0.2+14.10.20140815),
172172 libhardware2,
173173 libunity-core-6.0-9,
174174 pay-service,
plugins/Powerd/Powerd.cpp+16
@@ -25,6 +25,18 @@ void autoBrightnessChanged(GSettings *settings, const gchar *key, QDBusInterface
2525 unityScreen->asyncCall("userAutobrightnessEnable", QVariant(value));
2626}
2727
28+void activityTimeoutChanged(GSettings *settings, const gchar *key, QDBusInterface *unityScreen)
29+{
30+ int value = g_settings_get_uint(settings, key);
31+ unityScreen->asyncCall("setInactivityTimeouts", QVariant(value), QVariant(-1));
32+}
33+
34+void dimTimeoutChanged(GSettings *settings, const gchar *key, QDBusInterface *unityScreen)
35+{
36+ int value = g_settings_get_uint(settings, key);
37+ unityScreen->asyncCall("setInactivityTimeouts", QVariant(-1), QVariant(value));
38+}
39+
2840Powerd::Powerd(QObject* parent)
2941 : QObject(parent),
3042 unityScreen(NULL)
@@ -43,7 +55,11 @@ Powerd::Powerd(QObject* parent)
4355
4456 systemSettings = g_settings_new("com.ubuntu.touch.system");
4557 g_signal_connect(systemSettings, "changed::auto-brightness", G_CALLBACK(autoBrightnessChanged), unityScreen);
58+ g_signal_connect(systemSettings, "changed::activity-timeout", G_CALLBACK(activityTimeoutChanged), unityScreen);
59+ g_signal_connect(systemSettings, "changed::dim-timeout", G_CALLBACK(dimTimeoutChanged), unityScreen);
4660 autoBrightnessChanged(systemSettings, "auto-brightness", unityScreen);
61+ activityTimeoutChanged(systemSettings, "activity-timeout", unityScreen);
62+ dimTimeoutChanged(systemSettings, "dim-timeout", unityScreen);
4763}
4864
4965Powerd::~Powerd()