on xenial help sign in
fix MirSurface resizing in mock app manager
commit55618c3461e143215845cfbff4b28c5f0e4b6631 authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 17 Sep 2015, 12:36 (11 years ago) parent11ebd0b
2 files changed+9−2
tests/mocks/Unity/Application/MirSurface.cpp+7 tests/mocks/Unity/Application/MirSurfaceItem.cpp+2−2
tests/mocks/Unity/Application/MirSurface.cpp+7
@@ -170,13 +170,20 @@ int MirSurface::height() const
170170
171171void MirSurface::resize(int width, int height)
172172{
173+ bool changed = false;
173174 if (width != m_width) {
174175 m_width = width;
175176 Q_EMIT widthChanged();
177+ changed = true;
176178 }
177179
178180 if (m_height != height) {
179181 m_height = height;
180182 Q_EMIT heightChanged();
183+ changed = true;
184+ }
185+
186+ if (changed) {
187+ Q_EMIT sizeChanged(QSize(width, height));
181188 }
182189}
tests/mocks/Unity/Application/MirSurfaceItem.cpp+2−2
@@ -254,7 +254,7 @@ int MirSurfaceItem::surfaceWidth() const
254254
255255void MirSurfaceItem::setSurfaceWidth(int value)
256256{
257− if (m_surfaceWidth != value) {
257+ if (value != -1 && m_surfaceWidth != value) {
258258 m_surfaceWidth = value;
259259 Q_EMIT surfaceWidthChanged(m_surfaceWidth);
260260 updateSurfaceSize();
@@ -268,7 +268,7 @@ int MirSurfaceItem::surfaceHeight() const
268268
269269void MirSurfaceItem::setSurfaceHeight(int value)
270270{
271− if (m_surfaceHeight != value) {
271+ if (value != -1 && m_surfaceHeight != value) {
272272 m_surfaceHeight = value;
273273 Q_EMIT surfaceHeightChanged(m_surfaceHeight);
274274 updateSurfaceSize();