on xenial help sign in
DesktopStage: raise a new window that don't yet have a surface
commit7c2e17cd65abe3cd49f1d9d8d469454d3f87616d authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateWed 6 Apr 2016, 13:52 (11 years ago) parent4932508
3 files changed+9−3
qml/Stages/DesktopStage.qml+7−1 qml/Stages/PhoneStage.qml+1−1 qml/Stages/TabletStage.qml+1−1
qml/Stages/DesktopStage.qml+7−1
@@ -296,7 +296,7 @@ AbstractStage {
296296 target: model.application
297297 onFocusRequested: {
298298 if (!model.surface) {
299− // when an app has no surfaces, we assume there's only one entry representing it,
299+ // when an app has no surfaces, we assume there's only one entry representing it:
300300 // this delegate.
301301 claimFocus();
302302 } else {
@@ -311,6 +311,12 @@ AbstractStage {
311311
312312 if (focus) {
313313 priv.focusedAppDelegate = appDelegate;
314+
315+ // If we're orphan (!parent) it means this stage is no longer the current one
316+ // and will be deleted shortly. So we should no longer have a say over the model
317+ if (root.parent) {
318+ topLevelSurfaceList.raiseId(model.id);
319+ }
314320 } else if (!focus && priv.focusedAppDelegate === appDelegate) {
315321 priv.focusedAppDelegate = null;
316322 // FIXME: No idea why the Binding{} doens't update when focusedAppDelegate turns null
qml/Stages/PhoneStage.qml+1−1
@@ -540,7 +540,7 @@ AbstractStage {
540540 target: model.application
541541 onFocusRequested: {
542542 if (!model.surface) {
543− // when an app has no surfaces, we assume there's only one entry representing it,
543+ // when an app has no surfaces, we assume there's only one entry representing it:
544544 // this delegate.
545545 claimFocus();
546546 } else {
qml/Stages/TabletStage.qml+1−1
@@ -771,7 +771,7 @@ AbstractStage {
771771 target: model.application
772772 onFocusRequested: {
773773 if (!model.surface) {
774− // when an app has no surfaces, we assume there's only one entry representing it,
774+ // when an app has no surfaces, we assume there's only one entry representing it:
775775 // this delegate.
776776 spreadTile.focus = true;
777777 } else {