aboutsummaryrefslogtreecommitdiffstats
path: root/Main.qml
diff options
context:
space:
mode:
authorDaniel d'Andrada <daniel.dandrada@luxoft.com>2018-04-12 14:56:42 +0200
committerBramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com>2018-04-13 11:54:07 +0000
commit5e83ee3430388041442aaeede6e54799dee552d6 (patch)
treec9b1b2960d4582b61140ec7e1ed361e9302436a1 /Main.qml
parentcf462085a60049703337ce4b5050809878528886 (diff)
[sysui] Load UI in two stages to get a first frame drawn faster
Change-Id: Id43b25e3549e05c503619df086596b3789a730ea Reviewed-by: Lukáš Tinkl <ltinkl@luxoft.com> Reviewed-by: Bramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com>
Diffstat (limited to 'Main.qml')
-rw-r--r--Main.qml18
1 files changed, 18 insertions, 0 deletions
diff --git a/Main.qml b/Main.qml
index 3f2756b8..91e60567 100644
--- a/Main.qml
+++ b/Main.qml
@@ -54,6 +54,24 @@ Window {
readonly property real smallerDimension: isLandscape ? height : width
readonly property real largerDimension: isLandscape ? width : height
+ // Load the full UI once a frame has been drawn with the ligth version of it
+ // The very first frame is a blank. Only the second one has actual content,
+ // hence the counter.
+ // FIXME: Find a better way of finding out when the first proper frame has been
+ // rendered (scene no longer dirty. render thread idle)
+ Connections {
+ id: windowConns
+ property int frameCount: 0
+ target: root
+ onFrameSwapped: {
+ frameCount = frameCount + 1;
+ if (frameCount === 2) {
+ display.loadUI();
+ windowConns.enabled = false;
+ }
+ }
+ }
+
Display {
id: display