on xenial help sign in
Set initial surface size

Removes flicker on start up in desktop mode

commit75771975fff797cd64a86f93c962eb4a75bdef07 authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateTue 19 Jan 2016, 15:41 (11 years ago) parente2e7e7d
6 files changed+31−7
CMakeLists.txt+1−1 debian/control+3−3 qml/Stages/ApplicationWindow.qml+7−1 tests/mocks/Unity/Application/ApplicationInfo.cpp+14−1 tests/mocks/Unity/Application/ApplicationInfo.h+4−1 tests/plugins/Unity/Launcher/launchermodeltest.cpp+2
CMakeLists.txt+1−1
@@ -57,7 +57,7 @@ find_package(Qt5DBus 5.4 REQUIRED)
5757find_package(Qt5Concurrent 5.4 REQUIRED)
5858find_package(Qt5Sql 5.4 REQUIRED)
5959
60−pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=12)
60+pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=13)
6161
6262# Standard install paths
6363include(GNUInstallDirs)
debian/control+3−3
@@ -29,7 +29,7 @@ Build-Depends: cmake,
2929 libqt5xmlpatterns5-dev,
3030 libsystemsettings-dev,
3131 libudev-dev,
32− libunity-api-dev (>= 7.105),
32+ libunity-api-dev (>= 7.106),
3333 libusermetricsoutput1-dev,
3434# Need those X11 libs touch emulation from mouse events in manual QML tests on a X11 desktop
3535 libx11-dev[!armhf],
@@ -132,7 +132,7 @@ Depends: qml-module-qtquick-layouts,
132132 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1627) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1627),
133133 qtdeclarative5-unity-notifications-plugin (>= 0.1.2) | unity-notifications-impl,
134134 ubuntu-thumbnailer-impl-0,
135− unity-application-impl-12,
135+ unity-application-impl-13,
136136 unity-notifications-impl-3,
137137 unity-plugin-scopes | unity-scopes-impl,
138138 unity-scopes-impl-9,
@@ -178,7 +178,7 @@ Pre-Depends: ${misc:Pre-Depends},
178178Depends: ${misc:Depends},
179179 ${shlibs:Depends},
180180Provides: unity-application-impl,
181− unity-application-impl-12,
181+ unity-application-impl-13,
182182Replaces: unity8-autopilot (<< 8.02+15.04.20150422-0ubuntu1)
183183Description: Fake environment for running Unity 8 shell
184184 Provides fake implementations of some QML modules used by Unity 8 shell
qml/Stages/ApplicationWindow.qml+7−1
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2014-2015 Canonical Ltd.
2+ * Copyright 2014-2016 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU Lesser General Public License as published by
@@ -82,6 +82,12 @@ FocusScope {
8282 property bool surfaceOldEnoughToBeResized: false
8383 }
8484
85+ Binding {
86+ target: root.application
87+ property: "initialSurfaceSize"
88+ value: Qt.size(root.requestedWidth, root.requestedHeight)
89+ }
90+
8591 Timer {
8692 id: surfaceInitTimer
8793 interval: 100
tests/mocks/Unity/Application/ApplicationInfo.cpp+14−1
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013-2015 Canonical, Ltd.
2+ * Copyright (C) 2013-2016 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -278,3 +278,16 @@ void ApplicationInfo::setExemptFromLifecycle(bool exemptFromLifecycle)
278278 Q_EMIT exemptFromLifecycleChanged(m_exemptFromLifecycle);
279279 }
280280}
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 @@
11/*
2− * Copyright (C) 2013-2015 Canonical, Ltd.
2+ * Copyright (C) 2013-2016 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -95,6 +95,8 @@ public:
9595 bool exemptFromLifecycle() const override;
9696 void setExemptFromLifecycle(bool) override;
9797
98+ QSize initialSurfaceSize() const override;
99+ void setInitialSurfaceSize(const QSize &size) override;
98100public:
99101 void setSession(Session* session);
100102 Session* session() const { return m_session; }
@@ -129,6 +131,7 @@ private:
129131 RequestedState m_requestedState;
130132 bool m_isTouchApp;
131133 bool m_exemptFromLifecycle;
134+ QSize m_initialSurfaceSize;
132135
133136 bool m_manualSurfaceCreation;
134137};
tests/plugins/Unity/Launcher/launchermodeltest.cpp+2
@@ -61,6 +61,8 @@ public:
6161 bool isTouchApp() const override { return true; }
6262 bool exemptFromLifecycle() const override { return false; }
6363 void setExemptFromLifecycle(bool) override {}
64+ QRect initialSurfaceGeometry() const override { return QRect(); }
65+ void setInitialSurfaceGeometry(const QRect &) override {}
6466
6567 // Methods used for mocking (not in the interface)
6668 void setFocused(bool focused) { m_focused = focused; Q_EMIT focusedChanged(focused); }