on xenial help sign in
Set initial surface size
7577197Daniel d'Andrada
CMakeLists.txt+1−1
@@ -57,7 +57,7 @@ find_package(Qt5DBus 5.4 REQUIRED)
57find_package(Qt5Concurrent 5.4 REQUIRED)
57find_package(Qt5Concurrent 5.4 REQUIRED)
58find_package(Qt5Sql 5.4 REQUIRED)
58find_package(Qt5Sql 5.4 REQUIRED)
59
59
60−pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=12)
60+pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=13)
61
61
62# Standard install paths
62# Standard install paths
63include(GNUInstallDirs)
63include(GNUInstallDirs)
debian/control+3−3
@@ -29,7 +29,7 @@ Build-Depends: cmake,
29 libqt5xmlpatterns5-dev,
29 libqt5xmlpatterns5-dev,
30 libsystemsettings-dev,
30 libsystemsettings-dev,
31 libudev-dev,
31 libudev-dev,
32− libunity-api-dev (>= 7.105),
32+ libunity-api-dev (>= 7.106),
33 libusermetricsoutput1-dev,
33 libusermetricsoutput1-dev,
34# Need those X11 libs touch emulation from mouse events in manual QML tests on a X11 desktop
34# Need those X11 libs touch emulation from mouse events in manual QML tests on a X11 desktop
35 libx11-dev[!armhf],
35 libx11-dev[!armhf],
@@ -132,7 +132,7 @@ Depends: qml-module-qtquick-layouts,
132 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1627) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1627),
132 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1627) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1627),
133 qtdeclarative5-unity-notifications-plugin (>= 0.1.2) | unity-notifications-impl,
133 qtdeclarative5-unity-notifications-plugin (>= 0.1.2) | unity-notifications-impl,
134 ubuntu-thumbnailer-impl-0,
134 ubuntu-thumbnailer-impl-0,
135− unity-application-impl-12,
135+ unity-application-impl-13,
136 unity-notifications-impl-3,
136 unity-notifications-impl-3,
137 unity-plugin-scopes | unity-scopes-impl,
137 unity-plugin-scopes | unity-scopes-impl,
138 unity-scopes-impl-9,
138 unity-scopes-impl-9,
@@ -178,7 +178,7 @@ Pre-Depends: ${misc:Pre-Depends},
178Depends: ${misc:Depends},
178Depends: ${misc:Depends},
179 ${shlibs:Depends},
179 ${shlibs:Depends},
180Provides: unity-application-impl,
180Provides: unity-application-impl,
181− unity-application-impl-12,
181+ unity-application-impl-13,
182Replaces: unity8-autopilot (<< 8.02+15.04.20150422-0ubuntu1)
182Replaces: unity8-autopilot (<< 8.02+15.04.20150422-0ubuntu1)
183Description: Fake environment for running Unity 8 shell
183Description: Fake environment for running Unity 8 shell
184 Provides fake implementations of some QML modules used by Unity 8 shell
184 Provides fake implementations of some QML modules used by Unity 8 shell
qml/Stages/ApplicationWindow.qml+7−1
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright 2014-2015 Canonical Ltd.
2+ * Copyright 2014-2016 Canonical Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
5 * it under the terms of the GNU Lesser General Public License as published by
@@ -82,6 +82,12 @@ FocusScope {
82 property bool surfaceOldEnoughToBeResized: false
82 property bool surfaceOldEnoughToBeResized: false
83 }
83 }
84
84
85+ Binding {
86+ target: root.application
87+ property: "initialSurfaceSize"
88+ value: Qt.size(root.requestedWidth, root.requestedHeight)
89+ }
90+
85 Timer {
91 Timer {
86 id: surfaceInitTimer
92 id: surfaceInitTimer
87 interval: 100
93 interval: 100
tests/mocks/Unity/Application/ApplicationInfo.cpp+14−1
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2013-2015 Canonical, Ltd.
2+ * Copyright (C) 2013-2016 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
@@ -278,3 +278,16 @@ void ApplicationInfo::setExemptFromLifecycle(bool exemptFromLifecycle)
278 Q_EMIT exemptFromLifecycleChanged(m_exemptFromLifecycle);
278 Q_EMIT exemptFromLifecycleChanged(m_exemptFromLifecycle);
279 }
279 }
280}
280}
281+
282+QSize ApplicationInfo::initialSurfaceSize() const
283+{
284+ return m_initialSurfaceSize;
285+}
286+
287+void ApplicationInfo::setInitialSurfaceGeometry(const QSize &size)
288+{
289+ if (size != m_initialSurfaceSize) {
290+ m_initialSurfaceSize = size;
291+ Q_EMIT initialSurfaceSizeChanged(m_initialSurfaceSize);
292+ }
293+}
tests/mocks/Unity/Application/ApplicationInfo.h+4−1
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2013-2015 Canonical, Ltd.
2+ * Copyright (C) 2013-2016 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
@@ -95,6 +95,8 @@ public:
95 bool exemptFromLifecycle() const override;
95 bool exemptFromLifecycle() const override;
96 void setExemptFromLifecycle(bool) override;
96 void setExemptFromLifecycle(bool) override;
97
97
98+ QSize initialSurfaceSize() const override;
99+ void setInitialSurfaceSize(const QSize &size) override;
98public:
100public:
99 void setSession(Session* session);
101 void setSession(Session* session);
100 Session* session() const { return m_session; }
102 Session* session() const { return m_session; }
@@ -129,6 +131,7 @@ private:
129 RequestedState m_requestedState;
131 RequestedState m_requestedState;
130 bool m_isTouchApp;
132 bool m_isTouchApp;
131 bool m_exemptFromLifecycle;
133 bool m_exemptFromLifecycle;
134+ QSize m_initialSurfaceSize;
132
135
133 bool m_manualSurfaceCreation;
136 bool m_manualSurfaceCreation;
134};
137};
tests/plugins/Unity/Launcher/launchermodeltest.cpp+2
@@ -61,6 +61,8 @@ public:
61 bool isTouchApp() const override { return true; }
61 bool isTouchApp() const override { return true; }
62 bool exemptFromLifecycle() const override { return false; }
62 bool exemptFromLifecycle() const override { return false; }
63 void setExemptFromLifecycle(bool) override {}
63 void setExemptFromLifecycle(bool) override {}
64+ QRect initialSurfaceGeometry() const override { return QRect(); }
65+ void setInitialSurfaceGeometry(const QRect &) override {}
64
66
65 // Methods used for mocking (not in the interface)
67 // Methods used for mocking (not in the interface)
66 void setFocused(bool focused) { m_focused = focused; Q_EMIT focusedChanged(focused); }
68 void setFocused(bool focused) { m_focused = focused; Q_EMIT focusedChanged(focused); }