2 * Copyright (C) 2016 Canonical, Ltd.
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
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 // FIXME: This is a hack around us not knowing whether the Repeater has finished creating its
22 // delegates on start up.
23 // This is a problem when the stage gets a TopLevelSurfaceList already populated with several
25 property bool startingUp: true
26 onStartingUpChanged: {
28 // the top-most surface must be the focused one.
29 var topmostDelegate = itemAt(0);
30 topmostDelegate.focus = true;
36 checkIfStillStartingUp();
40 function checkIfStillStartingUp() {
42 var missingDelegate = false;
43 for (i = 0; i < model.count && !missingDelegate; ++i) {
45 missingDelegate = true;
48 if (!missingDelegate) {