Merge lp:~mterry/unity-mir/drop-dbusscreen into lp:unity-mir

Proposed by Michael Terry
Status: Merged
Approved by: Gerry Boland
Approved revision: 164
Merged at revision: 192
Proposed branch: lp:~mterry/unity-mir/drop-dbusscreen
Merge into: lp:unity-mir
Diff against target: 250 lines (+8/-156)
8 files modified
debian/changelog (+6/-0)
debian/com.canonical.Unity.conf (+0/-18)
debian/libunity-mir1.install (+0/-1)
debian/libunity-mir1.maintscript (+1/-0)
src/unity-mir/CMakeLists.txt (+1/-4)
src/unity-mir/dbusscreen.cpp (+0/-91)
src/unity-mir/dbusscreen.h (+0/-39)
src/unity-mir/qmirserverapplication.cpp (+0/-3)
To merge this branch: bzr merge lp:~mterry/unity-mir/drop-dbusscreen
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Alberto Aguirre (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Thomas Voß (community) Needs Information
Review via email: mp+202236@code.launchpad.net

Commit message

Drop dbusscreen code because it has moved to unity-system-compositor.

Description of the change

Drop dbusscreen code because it has moved to unity-system-compositor.

 * Are there any related MPs required for this MP to build/function as expected? Please list.
 - No
 * Did you perform an exploratory manual test run of your code change and any related functionality?
 - Yes
 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
 - I am in the team

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Thomas Voß (thomas-voss) wrote :

Could you provide reviewers at least with some manual testing instructions to make sure that things don't break?

review: Needs Information
Revision history for this message
Michael Terry (mterry) wrote :

Trying to turn screen on and off again will exercise this code path. So if your device turns off, everything is fine. When testing, make sure you install from a built deb to get the proper conffile handling.

Also, I'm going to mark this WIP for now, because nested mode got temporarily reverted while we fix a regression.

Revision history for this message
Michael Terry (mterry) wrote :

OK! This is ready again. To test, just run with this code on your phone, reboot, and try turning the screen on and off again.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alberto Aguirre (albaguirre) :
review: Approve
Revision history for this message
Gerry Boland (gerboland) :
review: Approve
Revision history for this message
Gerry Boland (gerboland) wrote :

• Did you perform an exploratory manual test run of the code change and any related functionality?
Yes

• Did CI run pass? If not, please explain why.
Yep

lp:~mterry/unity-mir/drop-dbusscreen updated
165. By Michael Terry

Merge from trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-02-21 17:07:41 +0000
3+++ debian/changelog 2014-03-04 16:21:59 +0000
4@@ -1,3 +1,9 @@
5+unity-mir (0.3) UNRELEASED; urgency=medium
6+
7+ * Bump version so we can specify it for rm_conffile
8+
9+ -- Michael Terry <mterry@ubuntu.com> Sun, 19 Jan 2014 21:04:06 -0500
10+
11 unity-mir (0.2+14.04.20140221.1-0ubuntu1) trusty; urgency=low
12
13 [ Michael Terry ]
14
15=== removed file 'debian/com.canonical.Unity.conf'
16--- debian/com.canonical.Unity.conf 2013-10-07 21:41:32 +0000
17+++ debian/com.canonical.Unity.conf 1970-01-01 00:00:00 +0000
18@@ -1,18 +0,0 @@
19-<!DOCTYPE busconfig PUBLIC
20- "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
21- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
22-<busconfig>
23-
24- <policy user="phablet">
25- <allow own="com.canonical.Unity.Screen"/>
26- </policy>
27-
28- <policy context="default">
29- <deny send_interface="com.canonical.Unity.Screen"/>
30- </policy>
31-
32- <policy user="root">
33- <allow send_interface="com.canonical.Unity.Screen"/>
34- </policy>
35-
36-</busconfig>
37
38=== modified file 'debian/libunity-mir1.install'
39--- debian/libunity-mir1.install 2013-09-24 16:54:23 +0000
40+++ debian/libunity-mir1.install 2014-03-04 16:21:59 +0000
41@@ -1,3 +1,2 @@
42 usr/lib/*/libunity-mir.so.*
43 usr/lib/*/qt5/*
44-debian/com.canonical.Unity.conf etc/dbus-1/system.d/
45
46=== added file 'debian/libunity-mir1.maintscript'
47--- debian/libunity-mir1.maintscript 1970-01-01 00:00:00 +0000
48+++ debian/libunity-mir1.maintscript 2014-03-04 16:21:59 +0000
49@@ -0,0 +1,1 @@
50+rm_conffile /etc/dbus-1/system.d/com.canonical.Unity.conf 0.3
51
52=== modified file 'src/unity-mir/CMakeLists.txt'
53--- src/unity-mir/CMakeLists.txt 2014-02-21 17:07:32 +0000
54+++ src/unity-mir/CMakeLists.txt 2014-03-04 16:21:59 +0000
55@@ -14,7 +14,6 @@
56 set(
57 UNITY_MIR_HEADERS
58
59- dbusscreen.h
60 displayconfigurationpolicy.h
61 initialsurfaceplacementstrategy.h
62 qmirserverapplication.h
63@@ -36,7 +35,6 @@
64 add_library(
65 unity-mir SHARED
66
67- dbusscreen.cpp
68 displayconfigurationpolicy.cpp
69 initialsurfaceplacementstrategy.cpp
70 qmirserverapplication.cpp
71@@ -58,7 +56,7 @@
72
73 # We should not need this line according to the Qt5/CMake docs.
74 # However, when removing it, include paths are not set and linking to Qt5 fails.
75-qt5_use_modules(unity-mir Core Quick DBus)
76+qt5_use_modules(unity-mir Core Quick)
77
78 set_target_properties(
79 unity-mir
80@@ -72,7 +70,6 @@
81
82 Qt5::Core
83 Qt5::Quick
84- Qt5::DBus
85
86 ${CMAKE_THREAD_LIBS_INIT}
87
88
89=== removed file 'src/unity-mir/dbusscreen.cpp'
90--- src/unity-mir/dbusscreen.cpp 2014-02-04 01:53:24 +0000
91+++ src/unity-mir/dbusscreen.cpp 1970-01-01 00:00:00 +0000
92@@ -1,91 +0,0 @@
93-/*
94- * Copyright (C) 2013 Canonical, Ltd.
95- *
96- * This program is free software: you can redistribute it and/or modify it under
97- * the terms of the GNU Lesser General Public License version 3, as published by
98- * the Free Software Foundation.
99- *
100- * This program is distributed in the hope that it will be useful, but WITHOUT
101- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
102- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
103- * Lesser General Public License for more details.
104- *
105- * You should have received a copy of the GNU Lesser General Public License
106- * along with this program. If not, see <http://www.gnu.org/licenses/>.
107- */
108-
109-// mir
110-#include <mir/graphics/display.h>
111-#include <mir/graphics/display_configuration.h>
112-#include <mir/compositor/compositor.h>
113-#include <mir_toolkit/common.h>
114-
115-// qt
116-#include <QDBusConnection>
117-#include <QDebug>
118-
119-// local
120-#include "shellserverconfiguration.h"
121-#include "dbusscreen.h"
122-
123-namespace mc = mir::compositor;
124-namespace mg = mir::graphics;
125-
126-// Note: this class should be created only after when the Mir DisplayServer has started
127-DBusScreen::DBusScreen(ShellServerConfiguration *config, QObject *parent)
128- : QObject(parent)
129- , m_serverConfig(config)
130-{
131- QDBusConnection::systemBus().registerService("com.canonical.Unity.Screen");
132- // TODO ExportScriptableSlots shouldn't be needed but without it I don't get the methods :-/
133- QDBusConnection::systemBus().registerObject("/com/canonical/Unity/Screen", this,
134- QDBusConnection::ExportScriptableSlots |
135- QDBusConnection::ExportScriptableInvokables );
136-}
137-
138-bool DBusScreen::setScreenPowerMode(const QString &mode)
139-{
140- MirPowerMode newPowerMode;
141- // Note: the "standby" and "suspend" modes are mostly unused
142-
143- if (mode == "on") {
144- newPowerMode = MirPowerMode::mir_power_mode_on;
145- } else if (mode == "standby") {
146- newPowerMode = MirPowerMode::mir_power_mode_standby; // higher power "off" mode (fastest resume)
147- } else if (mode == "suspend") {
148- newPowerMode = MirPowerMode::mir_power_mode_suspend; // medium power "off" mode
149- } else if (mode == "off") {
150- newPowerMode = MirPowerMode::mir_power_mode_off; // lowest power "off" mode (slowest resume)
151- } else {
152- qWarning() << "DBusScreen: unknown mode type" << mode;
153- return false;
154- }
155-
156- std::shared_ptr<mg::Display> display = m_serverConfig->the_display();
157- std::shared_ptr<mg::DisplayConfiguration> displayConfig = display->configuration();
158- std::shared_ptr<mc::Compositor> compositor = m_serverConfig->the_compositor();
159-
160- displayConfig->for_each_output([&](const mg::DisplayConfigurationOutput displayConfigOutput) {
161- if (displayConfigOutput.power_mode != newPowerMode) {
162- displayConfig->configure_output(
163- displayConfigOutput.id, //unchanged
164- displayConfigOutput.used, //unchanged
165- displayConfigOutput.top_left, //unchanged
166- displayConfigOutput.current_mode_index, //unchanged
167- displayConfigOutput.current_format,
168- newPowerMode,
169- displayConfigOutput.orientation //unchanged
170- );
171- }
172- });
173-
174- if (newPowerMode != MirPowerMode::mir_power_mode_on)
175- compositor->stop();
176-
177- display->configure(*displayConfig.get());
178-
179- if (newPowerMode == MirPowerMode::mir_power_mode_on)
180- compositor->start();
181-
182- return true;
183-}
184
185=== removed file 'src/unity-mir/dbusscreen.h'
186--- src/unity-mir/dbusscreen.h 2013-09-25 09:30:08 +0000
187+++ src/unity-mir/dbusscreen.h 1970-01-01 00:00:00 +0000
188@@ -1,39 +0,0 @@
189-/*
190- * Copyright (C) 2013 Canonical, Ltd.
191- *
192- * This program is free software: you can redistribute it and/or modify it under
193- * the terms of the GNU Lesser General Public License version 3, as published by
194- * the Free Software Foundation.
195- *
196- * This program is distributed in the hope that it will be useful, but WITHOUT
197- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
198- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
199- * Lesser General Public License for more details.
200- *
201- * You should have received a copy of the GNU Lesser General Public License
202- * along with this program. If not, see <http://www.gnu.org/licenses/>.
203- */
204-
205-#ifndef DBUSSCREEN_H
206-#define DBUSSCREEN_H
207-
208-// qt
209-#include <QObject>
210-
211-class ShellServerConfiguration;
212-
213-class DBusScreen : public QObject
214-{
215- Q_OBJECT
216- Q_CLASSINFO("D-Bus Interface", "com.canonical.Unity.Screen")
217-
218-public:
219- explicit DBusScreen(ShellServerConfiguration *config, QObject *parent = 0);
220-
221- Q_INVOKABLE Q_SCRIPTABLE bool setScreenPowerMode(const QString &mode);
222-
223-private:
224- ShellServerConfiguration *m_serverConfig;
225-};
226-
227-#endif // DBUSSCREEN_H
228
229=== modified file 'src/unity-mir/qmirserverapplication.cpp'
230--- src/unity-mir/qmirserverapplication.cpp 2013-09-25 09:43:14 +0000
231+++ src/unity-mir/qmirserverapplication.cpp 2014-03-04 16:21:59 +0000
232@@ -15,19 +15,16 @@
233 */
234
235 #include "qmirserverapplication.h"
236-#include "dbusscreen.h"
237
238 class QMirServerApplicationPrivate {
239 public:
240 QMirServerApplicationPrivate(ShellServerConfiguration* serverConfiguration, QMirServerApplication *qq)
241 : q_ptr(qq)
242 , serverConfiguration(serverConfiguration)
243- , dbusScreen(new DBusScreen(serverConfiguration))
244 {}
245
246 QMirServerApplication * const q_ptr;
247 ShellServerConfiguration *serverConfiguration;
248- QScopedPointer<DBusScreen> dbusScreen;
249 Q_DECLARE_PUBLIC(QMirServerApplication)
250 };
251

Subscribers

People subscribed via source and target branches