on xenial help sign in
merge prereq
5032e8fMichael Zanetti
plugins/GlobalShortcut/globalshortcutregistry.cpp+19−2
@@ -21,6 +21,20 @@
21
21
22#include "globalshortcutregistry.h"
22#include "globalshortcutregistry.h"
23
23
24+namespace {
25+QWindow* windowForShortcut(GlobalShortcut *sc) {
26+ QObject* parent= sc;
27+ while(parent) {
28+ if (auto item = qobject_cast<QQuickItem*>(parent)) {
29+ auto window = item->window();
30+ if (window) return window;
31+ }
32+ parent = parent->parent();
33+ }
34+ return nullptr;
35+}
36+} // namespace
37+
24GlobalShortcutRegistry::GlobalShortcutRegistry(QObject *parent)
38GlobalShortcutRegistry::GlobalShortcutRegistry(QObject *parent)
25 : QObject(parent)
39 : QObject(parent)
26{
40{
@@ -90,8 +104,11 @@ bool GlobalShortcutRegistry::eventFilter(QObject *obj, QEvent *event)
90 if (m_shortcuts.contains(seq)) {
104 if (m_shortcuts.contains(seq)) {
91 const auto shortcuts = m_shortcuts.value(seq);
105 const auto shortcuts = m_shortcuts.value(seq);
92 Q_FOREACH(const auto &shortcut, shortcuts) {
106 Q_FOREACH(const auto &shortcut, shortcuts) {
93− if (shortcut && shortcut->window() == obj) {
107+ if (shortcut) {
108+ auto window = windowForShortcut(shortcut);
109+ if (!window || window == obj) { // accept shortcut if it's not attached to a window or it's window is active.
94− qApp->sendEvent(shortcut, &eCopy);
110+ qApp->sendEvent(shortcut, &eCopy);
111+ }
95 }
112 }
96 }
113 }
97 }
114 }
qml/ApplicationMenus/ApplicationMenuItemFactory.qml+4−4
@@ -45,7 +45,7 @@ Object {
45
45
46 Action {
46 Action {
47 id: action
47 id: action
48− text: menuData.label.replace("_", "&")
48+ text: menuData && menuData.label.replace("_", "&") || ""
49 }
49 }
50
50
51 ListItemLayout {
51 ListItemLayout {
@@ -59,8 +59,8 @@ Object {
59 }
59 }
60
60
61 Label {
61 Label {
62− text: menuData.shortcut
62+ text: menuData && menuData.shortcut || ""
63− visible: menuData.shortcut && QuickUtils.keyboardAttached
63+ visible: menuData && menuData.shortcut && QuickUtils.keyboardAttached
64 SlotsLayout.position: SlotsLayout.Trailing
64 SlotsLayout.position: SlotsLayout.Trailing
65 color: enabled ? theme.palette.normal.backgroundSecondaryText :
65 color: enabled ? theme.palette.normal.backgroundSecondaryText :
66 theme.palette.disabled.backgroundSecondaryText
66 theme.palette.disabled.backgroundSecondaryText
@@ -86,7 +86,7 @@ Object {
86
86
87 Action {
87 Action {
88 id: action
88 id: action
89− text: menuData.label.replace("_", "&")
89+ text: menuData && menuData.label.replace("_", "&") || ""
90 }
90 }
91
91
92 ListItemLayout {
92 ListItemLayout {
qml/ApplicationMenus/MenuBar.qml+5−2
@@ -19,6 +19,7 @@ import QtQuick.Layouts 1.1
19import Utils 0.1
19import Utils 0.1
20import Ubuntu.Components 1.3
20import Ubuntu.Components 1.3
21import GlobalShortcut 1.0
21import GlobalShortcut 1.0
22+import "../Components/PanelState"
22
23
23Item {
24Item {
24 id: root
25 id: root
@@ -29,7 +30,7 @@ Item {
29 property bool enableKeyFilter: false
30 property bool enableKeyFilter: false
30 property real overflowWidth: width
31 property real overflowWidth: width
31 property bool windowMoving: false
32 property bool windowMoving: false
32− property var panelState: null
33+ property PanelState panelState
33
34
34 // read from outside
35 // read from outside
35 readonly property bool valid: rowRepeater.count > 0
36 readonly property bool valid: rowRepeater.count > 0
@@ -107,7 +108,9 @@ Item {
107
108
108 Component {
109 Component {
109 id: menuComponent
110 id: menuComponent
111+ MenuPopup {
110− MenuPopup { panelState: root.panelState }
112+ panelState: root.panelState
113+ }
111 }
114 }
112
115
113 Repeater {
116 Repeater {
qml/ApplicationMenus/MenuPopup.qml+2−2
@@ -26,7 +26,6 @@ UbuntuShape {
26 id: root
26 id: root
27 objectName: "menu"
27 objectName: "menu"
28 backgroundColor: theme.palette.normal.overlay
28 backgroundColor: theme.palette.normal.overlay
29− property PanelState panelState
30
29
31 signal childActivated()
30 signal childActivated()
32
31
@@ -65,6 +64,7 @@ UbuntuShape {
65 }
64 }
66
65
67 property alias unityMenuModel: repeater.model
66 property alias unityMenuModel: repeater.model
67+ property PanelState panelState
68
68
69 function show() {
69 function show() {
70 visible = true;
70 visible = true;
@@ -484,11 +484,11 @@ UbuntuShape {
484
484
485 onLoaded: {
485 onLoaded: {
486 item.unityMenuModel = Qt.binding(function() { return submenuLoader.unityMenuModel; });
486 item.unityMenuModel = Qt.binding(function() { return submenuLoader.unityMenuModel; });
487+ item.panelState = Qt.binding(function() { return root.panelState; });
487 item.objectName = Qt.binding(function() { return submenuLoader.objectName + "menu"; });
488 item.objectName = Qt.binding(function() { return submenuLoader.objectName + "menu"; });
488 item.desiredX = Qt.binding(function() { return submenuLoader.desiredX; });
489 item.desiredX = Qt.binding(function() { return submenuLoader.desiredX; });
489 item.desiredY = Qt.binding(function() { return submenuLoader.desiredY; });
490 item.desiredY = Qt.binding(function() { return submenuLoader.desiredY; });
490 item.substractWidth = Qt.binding(function() { return submenuLoader.substractWidth; });
491 item.substractWidth = Qt.binding(function() { return submenuLoader.substractWidth; });
491− item.panelState = Qt.binding(function() { return root.panelState; });
492 }
492 }
493
493
494 Keys.onLeftPressed: retreat()
494 Keys.onLeftPressed: retreat()
qml/OrientedShell.qml+1−1
@@ -261,7 +261,7 @@ Item {
261
261
262 Shell {
262 Shell {
263 id: shell
263 id: shell
264− objectName: "shell-"+screenWindow.objectName
264+ objectName: "shell"
265 width: root.width
265 width: root.width
266 height: root.height
266 height: root.height
267 orientation: root.angleToOrientation(orientationAngle)
267 orientation: root.angleToOrientation(orientationAngle)
qml/Panel/Panel.qml+2−2
@@ -221,7 +221,7 @@ Item {
221 sourceComponent: MenuBar {
221 sourceComponent: MenuBar {
222 id: bar
222 id: bar
223 objectName: "menuBar"
223 objectName: "menuBar"
224− anchors.left: parent.left
224+ anchors.left: menuBarLoader.left
225 anchors.margins: units.gu(1)
225 anchors.margins: units.gu(1)
226 height: menuBarLoader.height
226 height: menuBarLoader.height
227 enableKeyFilter: valid && panelState.decorationsVisible
227 enableKeyFilter: valid && panelState.decorationsVisible
@@ -345,7 +345,7 @@ Item {
345 opacity: __applicationMenus.visible && !__applicationMenus.expanded ? 1 : 0
345 opacity: __applicationMenus.visible && !__applicationMenus.expanded ? 1 : 0
346 visible: opacity != 0
346 visible: opacity != 0
347 Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.SnapDuration } }
347 Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.SnapDuration } }
348− text: PanelState.title
348+ text: panelState.title
349 }
349 }
350
350
351 PanelMenu {
351 PanelMenu {
qml/Shell.qml+1−3
@@ -45,7 +45,6 @@ import Unity.DashCommunicator 0.1
45import Unity.Indicators 0.1 as Indicators
45import Unity.Indicators 0.1 as Indicators
46import Cursor 1.1
46import Cursor 1.1
47import WindowManager 1.0
47import WindowManager 1.0
48−import Unity.Debug 0.1 as Debug
49
48
50
49
51StyledItem {
50StyledItem {
@@ -801,10 +800,9 @@ StyledItem {
801
800
802 Cursor {
801 Cursor {
803 id: cursor
802 id: cursor
804− objectName: "Pointer-"+screenWindow.objectName
803+ objectName: "cursor"
805
804
806 z: itemGrabber.z + 1
805 z: itemGrabber.z + 1
807− opacity: 0
808 topBoundaryOffset: panel.panelHeight
806 topBoundaryOffset: panel.panelHeight
809 enabled: shell.hasMouse && screenWindow.active
807 enabled: shell.hasMouse && screenWindow.active
810 visible: enabled
808 visible: enabled
tests/mocks/Unity/Application/SurfaceManager.cpp+2−1
@@ -367,6 +367,7 @@ void SurfaceManager::createInputMethodSurface()
367 if (!m_virtualKeyboard) {
367 if (!m_virtualKeyboard) {
368 m_virtualKeyboard = new VirtualKeyboard;
368 m_virtualKeyboard = new VirtualKeyboard;
369 registerSurface(m_virtualKeyboard);
369 registerSurface(m_virtualKeyboard);
370− Q_EMIT surfaceCreated(m_virtualKeyboard);
370+
371+ WindowManagementPolicy::instance()->addWindow(m_surfaceToWindow[m_virtualKeyboard].window);
371 }
372 }
372}
373}
tests/mocks/WindowManager/MockScreens.cpp−1
@@ -103,7 +103,6 @@ public:
103 }
103 }
104
104
105 QScreen* qscreen() const override {
105 QScreen* qscreen() const override {
106− qDebug() << "GET SCREEN" << qGuiApp->topLevelWindows();
107 if (qGuiApp->topLevelWindows().count() > 0) {
106 if (qGuiApp->topLevelWindows().count() > 0) {
108 return qGuiApp->topLevelWindows()[0]->screen();
107 return qGuiApp->topLevelWindows()[0]->screen();
109 }
108 }
tests/qmltests/ApplicationMenus/tst_MenuBar.qml+2
@@ -24,6 +24,7 @@ import Unity.Test 0.1
24import Utils 0.1
24import Utils 0.1
25
25
26import "../../../qml/ApplicationMenus"
26import "../../../qml/ApplicationMenus"
27+import "../../../qml/Components/PanelState"
27import ".."
28import ".."
28
29
29Item {
30Item {
@@ -65,6 +66,7 @@ Item {
65 id: menuBackend
66 id: menuBackend
66 modelData: appMenuData.generateTestData(10,5,2,3)
67 modelData: appMenuData.generateTestData(10,5,2,3)
67 }
68 }
69+ panelState: PanelState {}
68 }
70 }
69 }
71 }
70
72
tests/qmltests/ApplicationMenus/tst_MenuPopup.qml+2
@@ -24,6 +24,7 @@ import Unity.Test 0.1
24import Utils 0.1
24import Utils 0.1
25
25
26import "../../../qml/ApplicationMenus"
26import "../../../qml/ApplicationMenus"
27+import "../../../qml/Components/PanelState"
27import ".."
28import ".."
28
29
29Item {
30Item {
@@ -59,6 +60,7 @@ Item {
59 }}
60 }}
60 ]
61 ]
61 }
62 }
63+ panelState: PanelState {}
62 }
64 }
63 }
65 }
64
66
tests/qmltests/Panel/tst_Panel.qml+4−5
@@ -42,9 +42,7 @@ PanelTest {
42 value: keyboardAttached.checked
42 value: keyboardAttached.checked
43 }
43 }
44
44
45− readonly property var panelState: PanelState {
45+ readonly property alias panelState: panel.panelState
46−
47− }
48
46
49 ApplicationMenuDataLoader {
47 ApplicationMenuDataLoader {
50 id: appMenuData
48 id: appMenuData
@@ -88,7 +86,6 @@ PanelTest {
88
86
89 indicatorMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width
87 indicatorMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width
90 applicationMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width
88 applicationMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width
91− panelState: root.panelState
92
89
93 applicationMenus {
90 applicationMenus {
94 model: UnityMenuModel {
91 model: UnityMenuModel {
@@ -102,6 +99,8 @@ PanelTest {
102 model: root.indicatorsModel
99 model: root.indicatorsModel
103 hides: [ panel.applicationMenus ]
100 hides: [ panel.applicationMenus ]
104 }
101 }
102+
103+ panelState: PanelState {}
105 }
104 }
106 }
105 }
107 }
106 }
@@ -858,7 +857,7 @@ PanelTest {
858
857
859 var indicatorsBar = findChild(panel.applicationMenus, "indicatorsBar");
858 var indicatorsBar = findChild(panel.applicationMenus, "indicatorsBar");
860
859
861− root.panelState.title = "Fake Title"
860+ panelState.title = "Fake Title"
862 pullDownApplicationsMenu(0 /*xPos*/);
861 pullDownApplicationsMenu(0 /*xPos*/);
863 compare(aboutToShowCalledSpy.count, 1);
862 compare(aboutToShowCalledSpy.count, 1);
864
863
tests/qmltests/Stage/tst_DesktopStage.qml+5−8
@@ -44,10 +44,6 @@ Item {
44 value: false
44 value: false
45 }
45 }
46
46
47− PanelState {
48− id: panelStateObj
49− }
50−
51 Component.onCompleted: {
47 Component.onCompleted: {
52 ApplicationMenusLimits.screenWidth = Qt.binding( function() { return stageLoader.width; } );
48 ApplicationMenusLimits.screenWidth = Qt.binding( function() { return stageLoader.width; } );
53 ApplicationMenusLimits.screenHeight = Qt.binding( function() { return stageLoader.height; } );
49 ApplicationMenusLimits.screenHeight = Qt.binding( function() { return stageLoader.height; } );
@@ -100,7 +96,7 @@ Item {
100 topLevelSurfaceList: topSurfaceList
96 topLevelSurfaceList: topSurfaceList
101 interactive: true
97 interactive: true
102 mode: "windowed"
98 mode: "windowed"
103− panelState: panelStateObj
99+ panelState: PanelState {}
104 }
100 }
105 }
101 }
106 }
102 }
@@ -172,6 +168,7 @@ Item {
172
168
173 stage: stageLoader.status === Loader.Ready ? stageLoader.item : null
169 stage: stageLoader.status === Loader.Ready ? stageLoader.item : null
174 topLevelSurfaceList: topSurfaceList
170 topLevelSurfaceList: topSurfaceList
171+ property var panelState: stage ? stage.panelState : null
175
172
176 function init() {
173 function init() {
177 // wait until unity8-dash is up and running.
174 // wait until unity8-dash is up and running.
@@ -630,19 +627,19 @@ Item {
630 maximizeDelegate(facebookAppDelegate);
627 maximizeDelegate(facebookAppDelegate);
631
628
632 // verify the drop shadow is still not visible
629 // verify the drop shadow is still not visible
633− verify(panelStateObj.dropShadow == false);
630+ verify(panelState.dropShadow == false);
634
631
635 // start a foreground app, not maximized
632 // start a foreground app, not maximized
636 var dialerAppDelegate = startApplication("dialer-app");
633 var dialerAppDelegate = startApplication("dialer-app");
637
634
638 // verify the drop shadow becomes visible
635 // verify the drop shadow becomes visible
639− tryCompareFunction(function() { return panelStateObj.dropShadow; }, true);
636+ tryCompareFunction(function() { return panelState.dropShadow; }, true);
640
637
641 // close the maximized app
638 // close the maximized app
642 ApplicationManager.stopApplication("facebook-webapp");
639 ApplicationManager.stopApplication("facebook-webapp");
643
640
644 // verify the drop shadow is gone
641 // verify the drop shadow is gone
645− tryCompare(panelStateObj, "dropShadow", false);
642+ tryCompare(panelState, "dropShadow", false);
646 }
643 }
647
644
648 function test_threeFingerTapShowsWindowControls_data() {
645 function test_threeFingerTapShowsWindowControls_data() {
tests/qmltests/Stage/tst_PhoneStage.qml+2
@@ -19,6 +19,7 @@ import QtTest 1.0
19import Unity.Test 0.1 as UT
19import Unity.Test 0.1 as UT
20import ".."
20import ".."
21import "../../../qml/Components"
21import "../../../qml/Components"
22+import "../../../qml/Components/PanelState"
22import "../../../qml/Stage"
23import "../../../qml/Stage"
23import Ubuntu.Components 1.3
24import Ubuntu.Components 1.3
24import Unity.Application 0.1
25import Unity.Application 0.1
@@ -52,6 +53,7 @@ Item {
52 Component.onCompleted: {
53 Component.onCompleted: {
53 ApplicationManager.startApplication("unity8-dash");
54 ApplicationManager.startApplication("unity8-dash");
54 }
55 }
56+ panelState: PanelState {}
55 }
57 }
56
58
57 Flickable {
59 Flickable {
tests/qmltests/Tutorial/tst_Tutorial.qml+4−20
@@ -37,20 +37,10 @@ Rectangle {
37 height: units.gu(71)
37 height: units.gu(71)
38
38
39 QtObject {
39 QtObject {
40− id: applicationArguments
40+ id: _screenWindow
41−
41+ property bool primary: true
42− function hasGeometry() {
43− return false;
44− }
45−
46− function width() {
47− return 0;
48− }
49−
50− function height() {
51− return 0;
52− }
53 }
42 }
43+ property alias screenWindow: _screenWindow
54
44
55 Telephony.CallEntry {
45 Telephony.CallEntry {
56 id: phoneCall
46 id: phoneCall
@@ -256,13 +246,7 @@ Rectangle {
256 property real halfWidth: shell ? shell.width / 2 : 0
246 property real halfWidth: shell ? shell.width / 2 : 0
257 property real halfHeight: shell ? shell.height / 2 : 0
247 property real halfHeight: shell ? shell.height / 2 : 0
258
248
259− onShellChanged: {
249+ topLevelSurfaceList: shell ? shell.topLevelSurfaceList : null;
260− if (shell) {
261− topLevelSurfaceList = testCase.findInvisibleChild(shell, "topLevelSurfaceList");
262− } else {
263− topLevelSurfaceList = null;
264− }
265− }
266
250
267 function init() {
251 function init() {
268 prepareShell();
252 prepareShell();
tests/qmltests/tst_OrientedShell.qml+3−5
@@ -449,8 +449,8 @@ Rectangle {
449 when: windowShown
449 when: windowShown
450
450
451 property Item orientedShell: orientedShellLoader.status === Loader.Ready ? orientedShellLoader.item : null
451 property Item orientedShell: orientedShellLoader.status === Loader.Ready ? orientedShellLoader.item : null
452− property Item shell
452+ property Item shell: null
453− property QtObject topLevelSurfaceList
453+ property QtObject topLevelSurfaceList : shell ? shell.topLevelSurfaceList : null
454 property var panelState: undefined
454 property var panelState: undefined
455
455
456 onOrientedShellChanged: {
456 onOrientedShellChanged: {
@@ -518,7 +518,6 @@ Rectangle {
518 function cleanup() {
518 function cleanup() {
519 tryCompare(shell, "waitingOnGreeter", false, 10000); // make sure greeter didn't leave us in disabled state
519 tryCompare(shell, "waitingOnGreeter", false, 10000); // make sure greeter didn't leave us in disabled state
520 shell = null;
520 shell = null;
521− topLevelSurfaceList = null;
522
521
523 tearDown();
522 tearDown();
524 }
523 }
@@ -1477,8 +1476,7 @@ Rectangle {
1477 removeTimeConstraintsFromSwipeAreas(orientedShellLoader.item);
1476 removeTimeConstraintsFromSwipeAreas(orientedShellLoader.item);
1478
1477
1479 shell = findChild(orientedShell, "shell");
1478 shell = findChild(orientedShell, "shell");
1480−
1479+ verify(shell);
1481− topLevelSurfaceList = findInvisibleChild(shell, "topLevelSurfaceList");
1482 verify(topLevelSurfaceList);
1480 verify(topLevelSurfaceList);
1483
1481
1484 tryCompare(shell, "waitingOnGreeter", false); // reset by greeter when ready
1482 tryCompare(shell, "waitingOnGreeter", false); // reset by greeter when ready
tests/qmltests/tst_Shell.qml+10−14
@@ -38,7 +38,6 @@ import Unity.Indicators 0.1 as Indicators
38
38
39import "../../qml"
39import "../../qml"
40import "../../qml/Components"
40import "../../qml/Components"
41−import "../../qml/Components/PanelState"
42import "Stage"
41import "Stage"
43
42
44Rectangle {
43Rectangle {
@@ -57,19 +56,16 @@ Rectangle {
57 id: appMenuData
56 id: appMenuData
58 }
57 }
59
58
60− property var shell: shellLoader.item ? shellLoader.item : null
59+ readonly property var shell: shellLoader.item ? shellLoader.item : null
61 onShellChanged: {
60 onShellChanged: {
62 if (shell) {
61 if (shell) {
63− topLevelSurfaceList = shell.topLevelSurfaceList;
64 panelState = testCase.findInvisibleChild(shell, "panelState");
62 panelState = testCase.findInvisibleChild(shell, "panelState");
65 } else {
63 } else {
66− topLevelSurfaceList = null;
64+ panelState = null;
67− panelState = undefined;
68 }
65 }
69 }
66 }
70−
71− property var topLevelSurfaceList: null
67+ property var panelState: null
72− property var panelState: undefined
68+ readonly property alias topLevelSurfaceList: testCase.topLevelSurfaceList
73
69
74 QtObject {
70 QtObject {
75 id: _screenWindow
71 id: _screenWindow
@@ -569,6 +565,7 @@ Rectangle {
569 when: windowShown
565 when: windowShown
570
566
571 property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
567 property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
568+ topLevelSurfaceList: shell ? shell.topLevelSurfaceList : null
572
569
573 function init() {
570 function init() {
574 if (shellLoader.active) {
571 if (shellLoader.active) {
@@ -607,7 +604,6 @@ Rectangle {
607 waitForGreeterToStabilize();
604 waitForGreeterToStabilize();
608
605
609 // from StageTestCase
606 // from StageTestCase
610− topLevelSurfaceList = shell.topLevelSurfaceList;
611 verify(topLevelSurfaceList);
607 verify(topLevelSurfaceList);
612 stage = findChild(shell, "stage");
608 stage = findChild(shell, "stage");
613
609
@@ -2659,9 +2655,9 @@ Rectangle {
2659
2655
2660 function test_oskDisplacesWindow_data() {
2656 function test_oskDisplacesWindow_data() {
2661 return [
2657 return [
2662− {tag: "no need to displace", windowHeight: units.gu(10), windowY: units.gu(5), targetDisplacement: units.gu(5), oskEnabled: true},
2658+ {tag: "no need to displace", windowHeight: units.gu(10), windowY: units.gu(5), targetDisplacement: function() { return units.gu(5); }, oskEnabled: true},
2663− {tag: "displace to top", windowHeight: units.gu(50), windowY: units.gu(10), targetDisplacement: panelState.panelHeight, oskEnabled: true},
2659+ {tag: "displace to top", windowHeight: units.gu(50), windowY: units.gu(10), targetDisplacement: function() { return panelState.panelHeight; }, oskEnabled: true},
2664− {tag: "osk not on this screen", windowHeight: units.gu(40), windowY: units.gu(10), targetDisplacement: units.gu(10), oskEnabled: false},
2660+ {tag: "osk not on this screen", windowHeight: units.gu(40), windowY: units.gu(10), targetDisplacement: function() { return units.gu(10); }, oskEnabled: false},
2665 ]
2661 ]
2666 }
2662 }
2667
2663
@@ -2687,7 +2683,7 @@ Rectangle {
2687 verify(initialY > panelState.panelHeight);
2683 verify(initialY > panelState.panelHeight);
2688
2684
2689 topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, root.height / 2, root.width, root.height / 2));
2685 topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, root.height / 2, root.width, root.height / 2));
2690− tryCompare(dashAppDelegate, "y", data.targetDisplacement);
2686+ tryCompare(dashAppDelegate, "y", data.targetDisplacement());
2691
2687
2692 topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, 0, 0, 0));
2688 topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, 0, 0, 0));
2693 tryCompare(dashAppDelegate, "y", initialY);
2689 tryCompare(dashAppDelegate, "y", initialY);
@@ -3120,7 +3116,7 @@ Rectangle {
3120 // double click the panel
3116 // double click the panel
3121 var panel = findChild(shell, "panel");
3117 var panel = findChild(shell, "panel");
3122 verify(panel);
3118 verify(panel);
3123− mouseDoubleClickSequence(panel, panel.width/2, PanelState.panelHeight/2, Qt.LeftButton, Qt.NoModifier, 300);
3119+ mouseDoubleClickSequence(panel, panel.width/2, panelState.panelHeight/2, Qt.LeftButton, Qt.NoModifier, 300);
3124 tryCompare(appDelegate, "state", "restored");
3120 tryCompare(appDelegate, "state", "restored");
3125 }
3121 }
3126
3122
tests/qmltests/tst_ShellApplication.qml+6
@@ -159,4 +159,10 @@ Rectangle {
159
159
160 ShellApplication {
160 ShellApplication {
161 }
161 }
162+
163+ UnityTestCase {
164+ id: testCase
165+ name: "ShellApplication"
166+ when: windowShown
167+ }
162}
168}
tests/qmltests/tst_ShellWithPin.qml+4−16
@@ -41,20 +41,10 @@ Item {
41 }
41 }
42
42
43 QtObject {
43 QtObject {
44− id: applicationArguments
44+ id: _screenWindow
45−
45+ property bool primary: true
46− function hasGeometry() {
47− return false;
48− }
49−
50− function width() {
51− return 0;
52− }
53−
54− function height() {
55− return 0;
56− }
57 }
46 }
47+ property alias screenWindow: _screenWindow
58
48
59 Row {
49 Row {
60 id: contentRow
50 id: contentRow
@@ -143,6 +133,7 @@ Item {
143 when: windowShown
133 when: windowShown
144
134
145 property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
135 property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
136+ topLevelSurfaceList: shell ? shell.topLevelSurfaceList : null
146
137
147 function init() {
138 function init() {
148 tryCompare(shell, "waitingOnGreeter", false); // will be set when greeter is all ready
139 tryCompare(shell, "waitingOnGreeter", false); // will be set when greeter is all ready
@@ -159,7 +150,6 @@ Item {
159
150
160 // from StageTestCase
151 // from StageTestCase
161 stage = findChild(shell, "stage");
152 stage = findChild(shell, "stage");
162− topLevelSurfaceList = findInvisibleChild(shell, "topLevelSurfaceList");
163 verify(topLevelSurfaceList);
153 verify(topLevelSurfaceList);
164
154
165 startApplication("unity8-dash");
155 startApplication("unity8-dash");
@@ -168,8 +158,6 @@ Item {
168 function cleanup() {
158 function cleanup() {
169 tryCompare(shell, "waitingOnGreeter", false); // make sure greeter didn't leave us in disabled state
159 tryCompare(shell, "waitingOnGreeter", false); // make sure greeter didn't leave us in disabled state
170
160
171− topLevelSurfaceList = null;
172−
173 shellLoader.itemDestroyed = false
161 shellLoader.itemDestroyed = false
174
162
175 shellLoader.active = false
163 shellLoader.active = false
tests/utils/modules/Unity/Test/StageTestCase.qml+1−1
@@ -62,7 +62,7 @@ UnityTestCase {
62
62
63 return findChild(stage, "appDelegate_" + surfaceId);
63 return findChild(stage, "appDelegate_" + surfaceId);
64 } catch(err) {
64 } catch(err) {
65− throw new Error("startApplication("+appId+") called from line " + util.callerLine(1) + " failed!");
65+ throw new Error("startApplication("+appId+") called from line " + util.callerLine(1) + " failed! - " + err);
66 }
66 }
67 }
67 }
68}
68}