on xenial help sign in
DesktopStage: raise a new window that don't yet have a surface
7c2e17cDaniel d'Andrada
qml/Stages/DesktopStage.qml+7−1
@@ -296,7 +296,7 @@ AbstractStage {
296 target: model.application
296 target: model.application
297 onFocusRequested: {
297 onFocusRequested: {
298 if (!model.surface) {
298 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:
300 // this delegate.
300 // this delegate.
301 claimFocus();
301 claimFocus();
302 } else {
302 } else {
@@ -311,6 +311,12 @@ AbstractStage {
311
311
312 if (focus) {
312 if (focus) {
313 priv.focusedAppDelegate = appDelegate;
313 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+ }
314 } else if (!focus && priv.focusedAppDelegate === appDelegate) {
320 } else if (!focus && priv.focusedAppDelegate === appDelegate) {
315 priv.focusedAppDelegate = null;
321 priv.focusedAppDelegate = null;
316 // FIXME: No idea why the Binding{} doens't update when focusedAppDelegate turns null
322 // FIXME: No idea why the Binding{} doens't update when focusedAppDelegate turns null
qml/Stages/PhoneStage.qml+1−1
@@ -540,7 +540,7 @@ AbstractStage {
540 target: model.application
540 target: model.application
541 onFocusRequested: {
541 onFocusRequested: {
542 if (!model.surface) {
542 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:
544 // this delegate.
544 // this delegate.
545 claimFocus();
545 claimFocus();
546 } else {
546 } else {
qml/Stages/TabletStage.qml+1−1
@@ -771,7 +771,7 @@ AbstractStage {
771 target: model.application
771 target: model.application
772 onFocusRequested: {
772 onFocusRequested: {
773 if (!model.surface) {
773 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:
775 // this delegate.
775 // this delegate.
776 spreadTile.focus = true;
776 spreadTile.focus = true;
777 } else {
777 } else {