@@ -50,6 +50,8 @@ AbstractStage {
51 orientationChangesEnabled: true
51 orientationChangesEnabled: true
53+ onAltTabPressedChanged: priv.goneToSpread = altTabPressed
53 GlobalShortcut {
55 GlobalShortcut {
54 id: closeWindowShortcut
56 id: closeWindowShortcut
55 shortcut: Qt.AltModifier|Qt.Key_F4
57 shortcut: Qt.AltModifier|Qt.Key_F4
@@ -290,7 +292,7 @@ AbstractStage {
291 states: [
293 states: [
293− name: "spread"; when: root.altTabPressed || priv.goneToSpread
295+ name: "spread"; when: priv.goneToSpread
294 PropertyChanges { target: floatingFlickable; enabled: true }
296 PropertyChanges { target: floatingFlickable; enabled: true }
295 PropertyChanges { target: spreadItem; focus: true }
297 PropertyChanges { target: spreadItem; focus: true }
@@ -330,8 +332,9 @@ AbstractStage {
330 Transition {
332 Transition {
331 from: "spread"
333 from: "spread"
332 SequentialAnimation {
334 SequentialAnimation {
333− ScriptAction { script: {
335+ ScriptAction {
334− var item = appRepeater.itemAt(spreadItem.highlightedIndex);
337+ var item = appRepeater.itemAt(Math.max(0, spreadItem.highlightedIndex));
335 item.claimFocus();
338 item.claimFocus();
336 item.playFocusAnimation();
339 item.playFocusAnimation();
@@ -368,6 +371,10 @@ AbstractStage {
368 leftMargin: root.leftMargin
371 leftMargin: root.leftMargin
369 model: root.topLevelSurfaceList
372 model: root.topLevelSurfaceList
376+ priv.goneToSpread = false;
373 Connections {
380 Connections {