on xenial help sign in
Use new display power state DBus interface
commit31cd76f15f69a275e49a69e603bf873c21a0a568 authorAlberto Aguirre <alberto.aguirre@canonical.com> dateTue 13 May 2014, 21:18 (12 years ago) parent4ab3b3b
3 files changed+9−16
plugins/Powerd/Powerd.cpp+7−7 plugins/Powerd/Powerd.h+1−8 qml/Shell.qml+1−1
plugins/Powerd/Powerd.cpp+7−7
@@ -29,17 +29,17 @@ Powerd::Powerd(QObject* parent)
2929 : QObject(parent),
3030 powerd(NULL)
3131{
32− powerd = new QDBusInterface("com.canonical.powerd",
33− "/com/canonical/powerd",
34− "com.canonical.powerd",
32+ powerd = new QDBusInterface("com.canonical.Unity.Screen",
33+ "/com/canonical/Unity/Screen",
34+ "com.canonical.Unity.Screen",
3535 QDBusConnection::SM_BUSNAME(), this);
3636
37− powerd->connection().connect("com.canonical.powerd",
38− "/com/canonical/powerd",
39− "com.canonical.powerd",
37+ powerd->connection().connect("com.canonical.Unity.Screen",
38+ "/com/canonical/Unity/Screen",
39+ "com.canonical.Unity.Screen",
4040 "DisplayPowerStateChange",
4141 this,
42− SIGNAL(displayPowerStateChange(int, unsigned int)));
42+ SIGNAL(displayPowerStateChange(int)));
4343
4444 systemSettings = g_settings_new("com.ubuntu.touch.system");
4545 g_signal_connect(systemSettings, "changed::auto-brightness", G_CALLBACK(autoBrightnessChanged), powerd);
plugins/Powerd/Powerd.h+1−8
@@ -31,13 +31,6 @@ class Powerd: public QObject
3131 Q_FLAGS(DisplayFlag DisplayFlags)
3232
3333public:
34− enum DisplayFlag {
35− UseProximity = 1, // Use proximity sensor to override screen state
36− DisableAutoBrightness = 2, // Force autobrightness to be disabled
37− Bright = 4, // Request the screen to stay bright
38− };
39− Q_DECLARE_FLAGS(DisplayFlags, DisplayFlag)
40−
4134 enum Status {
4235 Off,
4336 On,
@@ -47,7 +40,7 @@ public:
4740 ~Powerd();
4841
4942Q_SIGNALS:
50− void displayPowerStateChange(int status, unsigned int flags);
43+ void displayPowerStateChange(int status);
5144
5245private:
5346 QDBusInterface *powerd;
qml/Shell.qml+1−1
@@ -432,7 +432,7 @@ FocusScope {
432432 onDisplayPowerStateChange: {
433433 // We ignore any display-off signals when the proximity sensor
434434 // is active. This usually indicates something like a phone call.
435− if (status == Powerd.Off && (flags & Powerd.UseProximity) == 0) {
435+ if (status == Powerd.Off) {
436436 greeter.showNow();
437437 }
438438