@@ -36,7 +36,6 @@ FocusScope {
3636 property bool altTabPressed
3737 property url background
3838 property int dragAreaWidth
39− property bool interactive
4039 property real nativeHeight
4140 property real nativeWidth
4241 property QtObject orientations
@@ -49,6 +48,11 @@ FocusScope {
4948 property real rightEdgePushProgress: 0
5049 property Item availableDesktopArea
5150
51+ // Whether outside forces say that the Stage may have focus
52+ property bool allowInteractivity
53+
54+ readonly property bool interactive: (state === "staged" || state === "stagedWithSideStage" || state === "windowed") && allowInteractivity
55+
5256 // Configuration
5357 property string mode: "staged"
5458
@@ -89,18 +93,17 @@ FocusScope {
8993 Qt.InvertedLandscapeOrientation;
9094 }
9195
96+ Binding {
97+ target: topLevelSurfaceList
98+ property: "rootFocus"
99+ value: interactive
100+ }
101+
92102 onInteractiveChanged: {
93103 // Stage must have focus before activating windows, including null
94104 if (interactive) {
95105 focus = true;
96106 }
97−
98− // This will:
99− // - If interactive: Try to reactivate last focused application.
100− // this will not happen if a pending activation is going on
101− // - If not interactive: Activate nullWindow, this makes
102− // sure none of the apps have focus when stage is not active
103− topLevelSurfaceList.rootFocus = interactive;
104107 }
105108
106109 onAltTabPressedChanged: {
@@ -1302,7 +1305,6 @@ FocusScope {
13021305 showHighlight: spreadItem.highlightedIndex === index
13031306 darkening: spreadItem.highlightedIndex >= 0
13041307 anchors.topMargin: dragArea.distance
1305− interactive: false
13061308 }
13071309 PropertyChanges {
13081310 target: appDelegate
@@ -1343,7 +1345,6 @@ FocusScope {
13431345 scaleToPreviewSize: spreadItem.stackHeight
13441346 scaleToPreviewProgress: stagedRightEdgeMaths.scaleToPreviewProgress
13451347 shadowOpacity: .3
1346− interactive: false
13471348 }
13481349 // make sure it's visible but transparent so it fades in when we transition to spread
13491350 PropertyChanges { target: windowInfoItem; opacity: 0; visible: true }