on xenial help sign in
MirSurfaceItem got a new property: fillMode

And put it to use in SurfaceContainer. That's the final piece to finally get rid of stretched windows Fixes: #1497083

commitec2dad30c23fc1291fdf87675a83514043fe1564 authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateTue 8 Dec 2015, 15:36 (11 years ago) parentd76d46969e4829
5 files changed+18−4
CMakeLists.txt+1−1 debian/control+3−3 qml/Stages/SurfaceContainer.qml+1 tests/mocks/Unity/Application/MirSurfaceItem.cpp+8 tests/mocks/Unity/Application/MirSurfaceItem.h+5
CMakeLists.txt+1−1
@@ -57,7 +57,7 @@ find_package(Qt5DBus 5.4 REQUIRED)
5757find_package(Qt5Concurrent 5.4 REQUIRED)
5858find_package(Qt5Sql 5.4 REQUIRED)
5959
60−pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=11)
60+pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=12)
6161
6262# Standard install paths
6363include(GNUInstallDirs)
debian/control+3−3
@@ -29,7 +29,7 @@ Build-Depends: cmake,
2929 libqt5xmlpatterns5-dev,
3030 libsystemsettings-dev,
3131 libudev-dev,
32− libunity-api-dev (>= 7.103),
32+ libunity-api-dev (>= 7.104),
3333 libusermetricsoutput1-dev,
3434 libxcb1-dev,
3535 pkg-config,
@@ -128,7 +128,7 @@ Depends: qml-module-qtquick-layouts,
128128 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1627) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1627),
129129 qtdeclarative5-unity-notifications-plugin (>= 0.1.2) | unity-notifications-impl,
130130 ubuntu-thumbnailer-impl-0,
131− unity-application-impl-11,
131+ unity-application-impl-12,
132132 unity-notifications-impl-3,
133133 unity-plugin-scopes | unity-scopes-impl,
134134 unity-scopes-impl-7,
@@ -174,7 +174,7 @@ Pre-Depends: ${misc:Pre-Depends},
174174Depends: ${misc:Depends},
175175 ${shlibs:Depends},
176176Provides: unity-application-impl,
177− unity-application-impl-11,
177+ unity-application-impl-12,
178178Replaces: unity8-autopilot (<< 8.02+15.04.20150422-0ubuntu1)
179179Description: Fake environment for running Unity 8 shell
180180 Provides fake implementations of some QML modules used by Unity 8 shell
qml/Stages/SurfaceContainer.qml+1
@@ -55,6 +55,7 @@ FocusScope {
5555 id: surfaceItem
5656 objectName: "surfaceItem"
5757
58+ fillMode: MirSurfaceItem.PadOrCrop
5859 consumesInput: true
5960
6061 surfaceWidth: {
tests/mocks/Unity/Application/MirSurfaceItem.cpp+8
@@ -305,3 +305,11 @@ void MirSurfaceItem::updateSurfaceSize()
305305 m_qmlSurface->resize(m_surfaceWidth, m_surfaceHeight);
306306 }
307307}
308+
309+void MirSurfaceItem::setFillMode(FillMode value)
310+{
311+ if (value != m_fillMode) {
312+ m_fillMode = value;
313+ Q_EMIT fillModeChanged(m_fillMode);
314+ }
315+}
tests/mocks/Unity/Application/MirSurfaceItem.h+5
@@ -62,6 +62,9 @@ public:
6262 int surfaceHeight() const override;
6363 void setSurfaceHeight(int value) override;
6464
65+ FillMode fillMode() const override { return m_fillMode; }
66+ void setFillMode(FillMode value) override;
67+
6568 /////
6669 // For use in qml tests
6770
@@ -107,6 +110,8 @@ private:
107110 int m_touchPressCount;
108111 int m_touchReleaseCount;
109112
113+ FillMode m_fillMode{Stretch};
114+
110115 friend class SurfaceManager;
111116};
112117