on xenial help sign in
fix binding loop when cascading windows
commit7321eb17f647a483b38ea0ada4a892cb0b7362fc authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 15 Sep 2016, 12:29 (10 years ago) parent429f5eb
1 file changed+10−7
qml/Stage/Stage.qml+10−7
qml/Stage/Stage.qml+10−7
@@ -581,11 +581,16 @@ AbstractStage {
581581
582582 // In those are for windowed mode. Those values basically store the window's properties
583583 // when having a floating window. If you want to move/resize a window in normal mode, this is what you want to write to.
584− property real windowedX: priv.focusedAppDelegate ? priv.focusedAppDelegate.windowedX + units.gu(3) : (normalZ - 1) * units.gu(3)
585− property real windowedY: priv.focusedAppDelegate ? priv.focusedAppDelegate.windowedY + units.gu(3) : normalZ * units.gu(3)
584+ property real windowedX
585+ property real windowedY
586586 property real windowedWidth
587587 property real windowedHeight
588588
589+ // unlike windowedX/Y, this is the last known grab position before being pushed against edges/corners
590+ // when restoring, the window should return to these, not to the place where it was dropped near the edge
591+ property real restoredX
592+ property real restoredY
593+
589594 Binding {
590595 target: appDelegate
591596 property: "y"
@@ -736,6 +741,9 @@ AbstractStage {
736741 decoratedWindow.surfaceOrientationAngle = 0;
737742 }
738743
744+ windowedX = priv.focusedAppDelegate ? priv.focusedAppDelegate.windowedX + units.gu(3) : (normalZ - 1) * units.gu(3)
745+ windowedY = priv.focusedAppDelegate ? priv.focusedAppDelegate.windowedY + units.gu(3) : normalZ * units.gu(3)
746+
739747 // NB: We're differentiating if this delegate was created in response to a new entry in the model
740748 // or if the Repeater is just populating itself with delegates to match the model it received.
741749 if (!appRepeater.startingUp) {
@@ -969,11 +977,6 @@ AbstractStage {
969977 breakPoint: spreadItem.rightEdgeBreakPoint
970978 }
971979
972− // unlike requestedX/Y, this is the last known grab position before being pushed against edges/corners
973− // when restoring, the window should return to these, not to the place where it was dropped near the edge
974− property real restoredX
975− property real restoredY
976−
977980 states: [
978981 State {
979982 name: "spread"; when: root.state == "spread"