on xenial help sign in
SurfaceManager from ShellApplication.qml
commit1a5e0d4d81e0f0e9913916caa32b6db989a3e783 authorNick Dedekind <nick.dedekind@canonical.com> dateFri 13 Jan 2017, 12:06 (10 years ago) parent59c04a7
7 files changed+20−7
qml/OrientedShell.qml+1 qml/Shell.qml+1−5 qml/ShellApplication.qml+4 qml/ShellScreen.qml+2 tests/mocks/Unity/Application/SurfaceManager.cpp+1−1 tests/qmltests/tst_OrientedShell.qml+5 tests/qmltests/tst_Shell.qml+6−1
qml/OrientedShell.qml+1
@@ -34,6 +34,7 @@ Item {
3434
3535 property alias deviceConfiguration: _deviceConfiguration
3636 property alias orientations: d.orientations
37+ property alias surfaceManager: shell.surfaceManager
3738
3839 onWidthChanged: calculateUsageMode();
3940
qml/Shell.qml+1−5
@@ -53,6 +53,7 @@ StyledItem {
5353 theme.name: "Ubuntu.Components.Themes.SuruDark"
5454
5555 // to be set from outside
56+ property alias surfaceManager: topLevelSurfaceList.surfaceManager
5657 property int orientationAngle: 0
5758 property int orientation
5859 property Orientations orientations
@@ -269,15 +270,10 @@ StyledItem {
269270 width: parent.width
270271 height: parent.height
271272
272− SurfaceManager {
273− id: surfaceMan
274− objectName: "surfaceManager"
275− }
276273 TopLevelWindowModel {
277274 id: topLevelSurfaceList
278275 objectName: "topLevelSurfaceList"
279276 applicationManager: ApplicationManager // it's a singleton
280− surfaceManager: surfaceMan
281277 }
282278
283279 Stage {
qml/ShellApplication.qml+4
@@ -17,17 +17,21 @@
1717import QtQuick 2.4
1818import QtQuick.Window 2.2
1919import Unity.Screens 0.1
20+import Unity.Application 0.1
2021
2122Instantiator {
2223 id: root
2324 model: Screens
2425
26+ property QtObject surfaceMan: SurfaceManager {}
27+
2528 ShellScreen {
2629 id: screen
2730 objectName: "screen"+index
2831 screen: model.screen
2932 visibility: applicationArguments.hasFullscreen ? Window.FullScreen : Window.Windowed
3033 flags: applicationArguments.hasFrameless ? Qt.FramelessWindowHint : 0
34+ surfaceManager: surfaceMan
3135
3236 Binding {
3337 when: applicationArguments.hasGeometry
qml/ShellScreen.qml+2
@@ -26,6 +26,7 @@ ScreenWindow {
2626 color: "black"
2727 title: "Unity8 Shell"
2828 property bool primary: false
29+ property QtObject surfaceManager: null
2930
3031 DeviceConfiguration {
3132 id: deviceConfiguration
@@ -49,6 +50,7 @@ ScreenWindow {
4950 OrientedShell {
5051 implicitWidth: screenWindow.width
5152 implicitHeight: screenWindow.height
53+ surfaceManager: screenWindow.surfaceManager
5254
5355 deviceConfiguration {
5456 name: Screens.count > 1 ? "desktop" : applicationArguments.deviceName
tests/mocks/Unity/Application/SurfaceManager.cpp+1−1
@@ -21,7 +21,7 @@
2121
2222#include <paths.h>
2323
24−#define SURFACEMANAGER_DEBUG 0
24+#define SURFACEMANAGER_DEBUG 1
2525
2626#if SURFACEMANAGER_DEBUG
2727#define DEBUG_MSG(params) qDebug().nospace() << "SurfaceManager[" << (void*)this << "]::" << __func__ << params
tests/qmltests/tst_OrientedShell.qml+5
@@ -172,6 +172,11 @@ Rectangle {
172172 Component.onDestruction: {
173173 orientedShellLoader.itemDestroyed = true;
174174 }
175+
176+ SurfaceManager {
177+ id: surfaceMan
178+ }
179+ surfaceManager: surfaceMan
175180 }
176181 }
177182 }
tests/qmltests/tst_Shell.qml+6−1
@@ -144,6 +144,11 @@ Rectangle {
144144 Component.onDestruction: {
145145 shellLoader.itemDestroyed = true;
146146 }
147+
148+ SurfaceManager {
149+ id: surfaceMan
150+ }
151+ surfaceManager: surfaceMan
147152 }
148153 }
149154 }
@@ -680,7 +685,7 @@ Rectangle {
680685 }
681686
682687 function ensureInputMethodSurface() {
683− var surfaceManager = findInvisibleChild(shell, "surfaceManager");
688+ var surfaceManager = shell.surfaceManager;
684689 verify(surfaceManager);
685690 surfaceManager.createInputMethodSurface();
686691