on xenial help sign in
Merge lp:~dandrader/unity8/noStretchOnResize
commit5a5376eeca0a249a6d56bc39364244d2b4a623ae authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateTue 24 Nov 2015, 15:31 (11 years ago) parentc78934c7ce0a05
10 files changed+302−48
qml/Stages/ApplicationWindow.qml+27−1 qml/Stages/DecoratedWindow.qml+7−2 qml/Stages/DesktopStage.qml+9−9 qml/Stages/SessionContainer.qml+25−1 qml/Stages/SurfaceContainer.qml+55−3 qml/Stages/WindowResizeArea.qml+64−19 tests/mocks/Unity/Application/MirSurface.cpp+52 tests/mocks/Unity/Application/MirSurface.h+16 tests/qmltests/Stages/tst_DesktopStage.qml+16−1 tests/qmltests/Stages/tst_WindowResizeArea.qml+31−12
qml/Stages/ApplicationWindow.qml+27−1
@@ -34,6 +34,8 @@ FocusScope {
3434 property QtObject application
3535 property int surfaceOrientationAngle
3636 property alias resizeSurface: sessionContainer.resizeSurface
37+ property int requestedWidth: -1
38+ property int requestedHeight: -1
3739
3840 QtObject {
3941 id: d
@@ -135,7 +137,9 @@ FocusScope {
135137 id: sessionContainer
136138 // A fake application might not even have a session property.
137139 session: application && application.session ? application.session : null
138− anchors.fill: parent
140+
141+ requestedWidth: root.requestedWidth
142+ requestedHeight: root.requestedHeight
139143
140144 surfaceOrientationAngle: application && application.rotatesWindowContents ? root.surfaceOrientationAngle : 0
141145
@@ -150,6 +154,28 @@ FocusScope {
150154 focus: true
151155 }
152156
157+ // SessionContainer size drives ApplicationWindow size
158+ Binding {
159+ target: root; property: "width"
160+ value: stateGroup.state === "surface" ? sessionContainer.width : root.requestedWidth
161+ when: root.requestedWidth >= 0
162+ }
163+ Binding {
164+ target: root; property: "height"
165+ value: stateGroup.state === "surface" ? sessionContainer.height : root.requestedHeight
166+ when: root.requestedHeight >= 0
167+ }
168+
169+ // ApplicationWindow size drives SessionContainer size
170+ Binding {
171+ target: sessionContainer; property: "width"; value: root.width
172+ when: root.requestedWidth < 0
173+ }
174+ Binding {
175+ target: sessionContainer; property: "height"; value: root.height
176+ when: root.requestedHeight < 0
177+ }
178+
153179 StateGroup {
154180 id: stateGroup
155181 objectName: "applicationWindowStateGroup"
qml/Stages/DecoratedWindow.qml+7−2
@@ -23,6 +23,9 @@ import Unity.Application 0.1
2323FocusScope {
2424 id: root
2525
26+ width: applicationWindow.width
27+ height: (root.decorationShown ? decoration.height : 0) + applicationWindow.height
28+
2629 property alias window: applicationWindow
2730 property alias application: applicationWindow.application
2831 property alias active: decoration.active
@@ -32,6 +35,9 @@ FocusScope {
3235 property bool highlightShown: false
3336 property real shadowOpacity: 1
3437
38+ property alias requestedWidth: applicationWindow.requestedWidth
39+ property real requestedHeight
40+
3541 signal close()
3642 signal maximize()
3743 signal minimize()
@@ -82,8 +88,7 @@ FocusScope {
8288 anchors.top: parent.top
8389 anchors.topMargin: decoration.height
8490 anchors.left: parent.left
85− width: root.width
86− height: root.height - decoration.height
91+ requestedHeight: root.requestedHeight - (root.decorationShown ? decoration.height : 0)
8792 interactive: true
8893 focus: true
8994 }
qml/Stages/DesktopStage.qml+9−9
@@ -219,9 +219,11 @@ AbstractStage {
219219 objectName: "appDelegate_" + appId
220220 z: ApplicationManager.count - index
221221 y: units.gu(3)
222− width: units.gu(60)
223− height: units.gu(50)
224− focus: appId === priv.focusedAppId
222+ width: decoratedWindow.width
223+ height: decoratedWindow.height
224+ property alias requestedWidth: decoratedWindow.requestedWidth
225+ property alias requestedHeight: decoratedWindow.requestedHeight
226+ focus: model.appId === priv.focusedAppId
225227
226228 QtObject {
227229 id: appDelegatePrivate
@@ -325,7 +327,7 @@ AbstractStage {
325327 PropertyChanges {
326328 target: appDelegate;
327329 x: 0; y: 0;
328− width: root.width; height: root.height;
330+ requestedWidth: root.width; requestedHeight: root.height;
329331 visuallyMinimized: false;
330332 visuallyMaximized: true
331333 }
@@ -355,14 +357,14 @@ AbstractStage {
355357 to: "normal"
356358 enabled: appDelegate.animationsEnabled
357359 PropertyAction { target: appDelegate; properties: "visuallyMinimized,visuallyMaximized" }
358− UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,width,height,scale"; duration: UbuntuAnimation.FastDuration }
360+ UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: UbuntuAnimation.FastDuration }
359361 },
360362 Transition {
361363 to: "maximized"
362364 enabled: appDelegate.animationsEnabled
363365 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
364366 SequentialAnimation {
365− UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,width,height,scale"; duration: UbuntuAnimation.FastDuration }
367+ UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: UbuntuAnimation.FastDuration }
366368 PropertyAction { target: appDelegate; property: "visuallyMaximized" }
367369 }
368370 },
@@ -371,7 +373,7 @@ AbstractStage {
371373 enabled: appDelegate.animationsEnabled
372374 PropertyAction { target: appDelegate; property: "visuallyMaximized" }
373375 SequentialAnimation {
374− UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,width,height,scale"; duration: UbuntuAnimation.FastDuration }
376+ UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: UbuntuAnimation.FastDuration }
375377 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
376378 ScriptAction {
377379 script: {
@@ -410,8 +412,6 @@ AbstractStage {
410412 objectName: "decoratedWindow"
411413 anchors.left: appDelegate.left
412414 anchors.top: appDelegate.top
413− width: appDelegate.width
414− height: appDelegate.height
415415 application: ApplicationManager.get(index)
416416 active: ApplicationManager.focusedApplicationId === model.appId
417417 focus: true
qml/Stages/SessionContainer.qml+25−1
@@ -29,13 +29,37 @@ FocusScope {
2929 property alias surfaceOrientationAngle: _surfaceContainer.surfaceOrientationAngle
3030 property alias resizeSurface: _surfaceContainer.resizeSurface
3131
32+ property int requestedWidth: -1
33+ property int requestedHeight: -1
34+
3235 readonly property alias surfaceContainer: _surfaceContainer
3336 SurfaceContainer {
3437 id: _surfaceContainer
35− anchors.fill: parent
38+ requestedWidth: root.requestedWidth
39+ requestedHeight: root.requestedHeight
3640 surface: session ? session.surface : null
3741 }
3842
43+ // SurfaceContainer size drives SessionContainer size
44+ Binding {
45+ target: root; property: "width"; value: _surfaceContainer.width
46+ when: root.requestedWidth >= 0
47+ }
48+ Binding {
49+ target: root; property: "height"; value: _surfaceContainer.height
50+ when: root.requestedHeight >= 0
51+ }
52+
53+ // SessionContainer size drives SurfaceContainer size
54+ Binding {
55+ target: _surfaceContainer; property: "width"; value: root.width
56+ when: root.requestedWidth < 0
57+ }
58+ Binding {
59+ target: _surfaceContainer; property: "height"; value: root.height
60+ when: root.requestedHeight < 0
61+ }
62+
3963 Repeater {
4064 id: childSessionsRepeater
4165 model: root.childSessions
qml/Stages/SurfaceContainer.qml+55−3
@@ -31,6 +31,9 @@ FocusScope {
3131 property string name: surface ? surface.name : ""
3232 property bool resizeSurface: true
3333
34+ property int requestedWidth: -1
35+ property int requestedHeight: -1
36+
3437 onSurfaceChanged: {
3538 if (surface) {
3639 surfaceItem.surface = surface;
@@ -54,16 +57,65 @@ FocusScope {
5457
5558 consumesInput: true
5659
57− surfaceWidth: root.resizeSurface ? width : -1
58− surfaceHeight: root.resizeSurface ? height : -1
60+ surfaceWidth: {
61+ if (root.resizeSurface) {
62+ if (root.requestedWidth >= 0) {
63+ return root.requestedWidth;
64+ } else {
65+ return width;
66+ }
67+ } else {
68+ return -1;
69+ }
70+ }
71+
72+ surfaceHeight: {
73+ if (root.resizeSurface) {
74+ if (root.requestedHeight >= 0) {
75+ return root.requestedHeight;
76+ } else {
77+ return height;
78+ }
79+ } else {
80+ return -1;
81+ }
82+ }
5983
60− anchors.fill: root
6184 enabled: root.interactive
6285 focus: true
6386 antialiasing: !root.interactive
6487 orientationAngle: root.surfaceOrientationAngle
6588 }
6689
90+ // MirSurface size drives SurfaceContainer size
91+ Binding {
92+ target: surfaceItem; property: "width"; value: root.surface ? root.surface.size.width : 0
93+ when: root.requestedWidth >= 0 && root.surface
94+ }
95+ Binding {
96+ target: surfaceItem; property: "height"; value: root.surface ? root.surface.size.height : 0
97+ when: root.requestedHeight >= 0 && root.surface
98+ }
99+ Binding {
100+ target: root; property: "width"; value: surfaceItem.width
101+ when: root.requestedWidth >= 0
102+ }
103+ Binding {
104+ target: root; property: "height"; value: surfaceItem.height
105+ when: root.requestedHeight >= 0
106+ }
107+
108+ // SurfaceContainer size drives MirSurface size
109+ Binding {
110+ target: surfaceItem; property: "width"; value: root.width
111+ when: root.requestedWidth < 0
112+ }
113+ Binding {
114+ target: surfaceItem; property: "height"; value: root.height
115+ when: root.requestedHeight < 0
116+ }
117+
118+
67119 TouchGate {
68120 targetItem: surfaceItem
69121 anchors.fill: root
qml/Stages/WindowResizeArea.qml+64−19
@@ -36,6 +36,8 @@ MouseArea {
3636 property int borderThickness: 0
3737 property int minWidth: 0
3838 property int minHeight: 0
39+ property int defaultWidth: units.gu(60)
40+ property int defaultHeight: units.gu(50)
3941 property int screenWidth: 0
4042 property int screenHeight: 0
4143
@@ -67,13 +69,14 @@ MouseArea {
6769 }
6870
6971 Component.onCompleted: {
70− var windowGeometry = windowStateStorage.getGeometry(root.windowId, Qt.rect(target.x, target.y, target.width, target.height))
71− if (windowGeometry !== undefined) {
72− target.width = Math.min(windowGeometry.width, root.screenWidth)
73− target.height = Math.min(windowGeometry.height, root.screenHeight - PanelState.panelHeight)
74− target.x = Math.max(Math.min(windowGeometry.x, root.screenWidth - target.width), 0)
75− target.y = Math.max(Math.min(windowGeometry.y, root.screenHeight - target.height), PanelState.panelHeight)
76− }
72+ var windowGeometry = windowStateStorage.getGeometry(root.windowId,
73+ Qt.rect(target.x, target.y, defaultWidth, defaultHeight));
74+
75+ target.requestedWidth = Math.min(Math.max(windowGeometry.width, minWidth), screenWidth);
76+ target.requestedHeight = Math.min(Math.max(windowGeometry.height, minHeight), root.screenHeight - PanelState.panelHeight);
77+ target.x = Math.max(Math.min(windowGeometry.x, root.screenWidth - target.requestedWidth), 0)
78+ target.y = Math.max(Math.min(windowGeometry.y, root.screenHeight - target.requestedHeight), PanelState.panelHeight)
79+
7780 var windowState = windowStateStorage.getState(root.windowId, WindowStateStorage.WindowStateNormal)
7881 if (windowState === WindowStateStorage.WindowStateMaximized) {
7982 target.maximize(false)
@@ -93,6 +96,18 @@ MouseArea {
9396 property bool topBorder: false
9497 property bool bottomBorder: false
9598
99+ // true - A change in surface size will cause the left border of the window to move accordingly.
100+ // The window's right border will stay in the same position.
101+ // false - a change in surface size will cause the right border of the window to move accordingly.
102+ // The window's left border will stay in the same position.
103+ property bool moveLeftBorder: false
104+
105+ // true - A change in surface size will cause the top border of the window to move accordingly.
106+ // The window's bottom border will stay in the same position.
107+ // false - a change in surface size will cause the bottom border of the window to move accordingly.
108+ // The window's top border will stay in the same position.
109+ property bool moveTopBorder: false
110+
96111 property bool dragging: false
97112 property real startMousePosX
98113 property real startMousePosY
@@ -100,6 +115,8 @@ MouseArea {
100115 property real startY
101116 property real startWidth
102117 property real startHeight
118+ property real currentWidth
119+ property real currentHeight
103120
104121 property string cursorName: {
105122 if (root.containsMouse || root.pressed) {
@@ -138,11 +155,24 @@ MouseArea {
138155 }
139156 }
140157
158+ Timer {
159+ id: resetBordersToMoveTimer
160+ interval: 2000
161+ onTriggered: {
162+ d.moveLeftBorder = false;
163+ d.moveTopBorder = false;
164+ }
165+ }
166+
141167 onPressedChanged: {
142168 var pos = mapToItem(target.parent, mouseX, mouseY);
143169
144170 if (pressed) {
145171 d.updateBorders();
172+ resetBordersToMoveTimer.stop();
173+ d.moveLeftBorder = d.leftBorder;
174+ d.moveTopBorder = d.topBorder;
175+
146176 var pos = mapToItem(root.target.parent, mouseX, mouseY);
147177 d.startMousePosX = pos.x;
148178 d.startMousePosY = pos.y;
@@ -150,8 +180,11 @@ MouseArea {
150180 d.startY = target.y;
151181 d.startWidth = target.width;
152182 d.startHeight = target.height;
183+ d.currentWidth = target.width;
184+ d.currentHeight = target.height;
153185 d.dragging = true;
154186 } else {
187+ resetBordersToMoveTimer.start();
155188 d.dragging = false;
156189 if (containsMouse) {
157190 d.updateBorders();
@@ -182,37 +215,49 @@ MouseArea {
182215 if (d.leftBorder) {
183216 var newTargetX = d.startX + deltaX;
184217 if (target.x + target.width > newTargetX + minWidth) {
185− target.width = target.x + target.width - newTargetX;
186− target.x = newTargetX;
218+ target.requestedWidth = target.x + target.width - newTargetX;
187219 } else {
188− target.x = target.x + target.width - minWidth;
189− target.width = minWidth;
220+ target.requestedWidth = minWidth;
190221 }
191222
192223 } else if (d.rightBorder) {
193224 if (d.startWidth + deltaX >= minWidth) {
194− target.width = d.startWidth + deltaX;
225+ target.requestedWidth = d.startWidth + deltaX;
195226 } else {
196− target.width = minWidth;
227+ target.requestedWidth = minWidth;
197228 }
198229 }
199230
200231 if (d.topBorder) {
201232 var newTargetY = d.startY + deltaY;
202233 if (target.y + target.height > newTargetY + minHeight) {
203− target.height = target.y + target.height - newTargetY;
204− target.y = newTargetY;
234+ target.requestedHeight = target.y + target.height - newTargetY;
205235 } else {
206− target.y = target.y + target.height - minHeight;
207− target.height = minHeight;
236+ target.requestedHeight = minHeight;
208237 }
209238
210239 } else if (d.bottomBorder) {
211240 if (d.startHeight + deltaY >= minHeight) {
212− target.height = d.startHeight + deltaY;
241+ target.requestedHeight = d.startHeight + deltaY;
213242 } else {
214− target.height = minHeight;
243+ target.requestedHeight = minHeight;
244+ }
245+ }
246+ }
247+
248+ Connections {
249+ target: root.target
250+ onWidthChanged: {
251+ if (d.moveLeftBorder) {
252+ target.x += d.currentWidth - target.width;
253+ }
254+ d.currentWidth = target.width;
255+ }
256+ onHeightChanged: {
257+ if (d.moveTopBorder) {
258+ target.y += d.currentHeight - target.height;
215259 }
260+ d.currentHeight = target.height;
216261 }
217262 }
218263}
tests/mocks/Unity/Application/MirSurface.cpp+52
@@ -35,8 +35,12 @@ MirSurface::MirSurface(const QString& name,
3535 , m_activeFocus(false)
3636 , m_width(-1)
3737 , m_height(-1)
38+ , m_slowToResize(false)
3839{
3940// qDebug() << "MirSurface::MirSurface() " << name;
41+ m_delayedResizeTimer.setInterval(600);
42+ m_delayedResizeTimer.setSingleShot(true);
43+ connect(&m_delayedResizeTimer, &QTimer::timeout, this, &MirSurface::applyDelayedResize);
4044}
4145
4246MirSurface::~MirSurface()
@@ -196,8 +200,39 @@ int MirSurface::height() const
196200}
197201
198202void MirSurface::resize(int width, int height)
203+{
204+ if (m_slowToResize) {
205+ if (!m_delayedResizeTimer.isActive()) {
206+ m_delayedResize.setWidth(width);
207+ m_delayedResize.setHeight(height);
208+ m_delayedResizeTimer.start();
209+ } else {
210+ m_pendingResize.setWidth(width);
211+ m_pendingResize.setHeight(height);
212+ }
213+ } else {
214+ doResize(width, height);
215+ }
216+}
217+
218+void MirSurface::applyDelayedResize()
219+{
220+ doResize(m_delayedResize.width(), m_delayedResize.height());
221+ m_delayedResize.setWidth(-1);
222+ m_delayedResize.setHeight(-1);
223+
224+ if (m_pendingResize.isValid()) {
225+ QSize size = m_pendingResize;
226+ m_pendingResize.setWidth(-1);
227+ m_pendingResize.setHeight(-1);
228+ resize(size.width(), size.height());
229+ }
230+}
231+
232+void MirSurface::doResize(int width, int height)
199233{
200234 bool changed = false;
235+
201236 if (width != m_width) {
202237 m_width = width;
203238 Q_EMIT widthChanged();
@@ -214,3 +249,20 @@ void MirSurface::resize(int width, int height)
214249 Q_EMIT sizeChanged(QSize(width, height));
215250 }
216251}
252+
253+bool MirSurface::isSlowToResize() const
254+{
255+ return m_slowToResize;
256+}
257+
258+void MirSurface::setSlowToResize(bool value)
259+{
260+ if (m_slowToResize != value) {
261+ m_slowToResize = value;
262+ Q_EMIT slowToResizeChanged();
263+ if (!m_slowToResize && m_delayedResizeTimer.isActive()) {
264+ m_delayedResizeTimer.stop();
265+ applyDelayedResize();
266+ }
267+ }
268+}
tests/mocks/Unity/Application/MirSurface.h+16
@@ -18,6 +18,7 @@
1818#define MOCK_MIR_SURFACE_H
1919
2020#include <QObject>
21+#include <QTimer>
2122#include <QUrl>
2223#include <QHash>
2324
@@ -33,6 +34,7 @@ class MirSurface : public unity::shell::application::MirSurfaceInterface
3334 Q_PROPERTY(int width READ width NOTIFY widthChanged)
3435 Q_PROPERTY(int height READ height NOTIFY heightChanged)
3536 Q_PROPERTY(bool activeFocus READ activeFocus NOTIFY activeFocusChanged)
37+ Q_PROPERTY(bool slowToResize READ isSlowToResize WRITE setSlowToResize NOTIFY slowToResizeChanged)
3638
3739public:
3840 MirSurface(const QString& name,
@@ -77,6 +79,9 @@ public:
7779 int width() const;
7880 int height() const;
7981
82+ bool isSlowToResize() const;
83+ void setSlowToResize(bool value);
84+
8085 /////
8186 // internal mock stuff
8287
@@ -94,13 +99,18 @@ Q_SIGNALS:
9499 void orientationAngleChanged(Mir::OrientationAngle angle);
95100 void widthChanged();
96101 void heightChanged();
102+ void slowToResizeChanged();
97103
98104 ////
99105 // internal mock stuff
100106 void screenshotUrlChanged(QUrl);
101107 void activeFocusChanged(bool);
102108
109+private Q_SLOTS:
110+ void applyDelayedResize();
111+
103112private:
113+ void doResize(int width, int height);
104114 void updateVisibility();
105115
106116 const QString m_name;
@@ -114,6 +124,12 @@ private:
114124 bool m_activeFocus;
115125 int m_width;
116126 int m_height;
127+
128+ bool m_slowToResize;
129+ QTimer m_delayedResizeTimer;
130+ QSize m_delayedResize;
131+ QSize m_pendingResize;
132+
117133 struct View {
118134 bool visible;
119135 };
tests/qmltests/Stages/tst_DesktopStage.qml+16−1
@@ -17,7 +17,7 @@
1717import QtQuick 2.4
1818import QtTest 1.0
1919import Ubuntu.Components 1.3
20−import Ubuntu.Components.ListItems 1.3 as ListItem
20+import Ubuntu.Components.ListItems 1.3
2121import Unity.Application 0.1
2222import Unity.Test 0.1
2323import Utils 0.1
@@ -82,6 +82,21 @@ Item {
8282 Column {
8383 anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
8484 spacing: units.gu(1)
85+
86+ Button {
87+ color: "white"
88+ text: "Make surface slow to resize"
89+ activeFocusOnPress: false
90+ onClicked: {
91+ if (ApplicationManager.focusedApplicationId) {
92+ var surface = ApplicationManager.findApplication(ApplicationManager.focusedApplicationId).session.surface;
93+ surface.slowToResize = true;
94+ }
95+ }
96+ }
97+
98+ Divider {}
99+
85100 Repeater {
86101 model: ApplicationManager.availableApplications
87102 ApplicationCheckBox {
tests/qmltests/Stages/tst_WindowResizeArea.qml+31−12
@@ -30,8 +30,6 @@ Item {
3030 height: units.gu(60)
3131 width: units.gu(60)
3232
33− property var fakeWindow: windowLoader.item
34−
3533 Binding {
3634 target: PanelState
3735 property: "panelHeight"
@@ -47,10 +45,10 @@ Item {
4745 property alias minHeight: windowResizeArea.minHeight
4846 x: units.gu(20)
4947 y: units.gu(20)
50− height: units.gu(20)
51− width: units.gu(20)
52− property int windowHeight: height
53− property int windowWidth: width
48+ width: requestedWidth
49+ height: requestedHeight
50+ property real requestedWidth
51+ property real requestedHeight
5452 state: "normal"
5553
5654 function maximize() {
@@ -63,6 +61,8 @@ Item {
6361 borderThickness: units.gu(2)
6462 minWidth: units.gu(15)
6563 minHeight: units.gu(10)
64+ defaultWidth: units.gu(20)
65+ defaultHeight: units.gu(20)
6666 windowId: "test-window-id"
6767 screenWidth: root.width
6868 screenHeight: root.height
@@ -87,22 +87,41 @@ Item {
8787 Loader {
8888 id: windowLoader
8989 sourceComponent: fakeWindowComponent
90+ active: windowLoaderCheckbox.checked
9091 }
9192
92− MouseTouchEmulationCheckbox {
93− checked: false
94− color: "black"
93+ Column {
94+ MouseTouchEmulationCheckbox {
95+ checked: false
96+ color: "black"
97+ }
98+ RowLayout {
99+ Layout.fillWidth: true
100+ CheckBox {
101+ id: windowLoaderCheckbox
102+ checked: true
103+ activeFocusOnPress: false
104+ }
105+ Label {
106+ id: label
107+ color: "black"
108+ text: "Window loader active"
109+ anchors.verticalCenter: parent.verticalCenter
110+ }
111+ }
95112 }
96113
97114 UnityTestCase {
98115 name: "WindowResizeArea"
99116 when: windowShown
100117
118+ property var fakeWindow: windowLoader.item
119+
101120 function init() {
102121 fakeWindow.x = units.gu(20)
103122 fakeWindow.y = units.gu(20)
104− fakeWindow.width = units.gu(20)
105− fakeWindow.height = units.gu(20)
123+ fakeWindow.requestedWidth = units.gu(20)
124+ fakeWindow.requestedHeight = units.gu(20)
106125 }
107126
108127 function test_resizeWindowRightBottom_data() {
@@ -188,7 +207,7 @@ Item {
188207 function test_resizeSmallerAndLarger_data() {
189208 return [
190209 { tag: "topLeft", startX: -1, startY: -1, dx: units.gu(15), dy: units.gu(15) },
191− { tag: "bottomRight", startX: fakeWindow.width + 1, startY: fakeWindow.height + 1, dx: -units.gu(15), dy: -units.gu(15) }
210+ { tag: "bottomRight", startX: units.gu(20) + 1, startY: units.gu(20) + 1, dx: -units.gu(15), dy: -units.gu(15) }
192211 ]
193212 }
194213