on xenial help sign in
Revert shell rotation.
00b6d21Michał Sawicz
debian/unity8.install−1
@@ -10,7 +10,6 @@ usr/share/unity8/Launcher
10usr/share/unity8/Notifications
10usr/share/unity8/Notifications
11usr/share/unity8/Panel
11usr/share/unity8/Panel
12usr/share/unity8/Shell.qml
12usr/share/unity8/Shell.qml
13−usr/share/unity8/ShellOrientator.qml
14usr/share/unity8/SideStage
13usr/share/unity8/SideStage
15usr/share/unity8/graphics
14usr/share/unity8/graphics
16data/unity8.conf usr/share/upstart/sessions/
15data/unity8.conf usr/share/upstart/sessions/
qml/Components/ApplicationManagerWrapper.qml−8
@@ -166,12 +166,4 @@ Item {
166 }
166 }
167 return desktopFile.substring(left+1, right);
167 return desktopFile.substring(left+1, right);
168 }
168 }
169−
170− function setMainStageAppRect(item) {
171− ApplicationManager.setMainStageAppRect(item);
172− }
173−
174− function setSideStageAppRect(item) {
175− ApplicationManager.setSideStageAppRect(item);
176− }
177}
169}
qml/Components/ApplicationScreenshot.qml+2−1
@@ -53,7 +53,8 @@ Item {
53 ApplicationImage {
53 ApplicationImage {
54 id: applicationImage
54 id: applicationImage
55 objectName: "screenshot image"
55 objectName: "screenshot image"
56− anchors.fill: parent
56+ width: applicationScreenshot.application ? parent.width : 0
57+ height: applicationScreenshot.application ? parent.height : 0
57 visible: applicationScreenshot.application != null && ready
58 visible: applicationScreenshot.application != null && ready
58 source: ApplicationManager.findApplication((application) ? application.appId : "")
59 source: ApplicationManager.findApplication((application) ? application.appId : "")
59 }
60 }
qml/Panel/MenuContent.qml−1
@@ -26,7 +26,6 @@ import "../Components"
26MainView {
26MainView {
27 id: content
27 id: content
28
28
29− nativeOrientationAngle: 0 // stop contents being re-rotated when shell in landscape
30 property QtObject indicatorsModel: null
29 property QtObject indicatorsModel: null
31 property bool __contentActive: false
30 property bool __contentActive: false
32 readonly property int currentMenuIndex: tabs.selectedTabIndex
31 readonly property int currentMenuIndex: tabs.selectedTabIndex
qml/Shell.qml+15−24
@@ -37,7 +37,6 @@ import Unity.Notifications 1.0 as NotificationBackend
37
37
38FocusScope {
38FocusScope {
39 id: shell
39 id: shell
40− objectName: "shell"
41
40
42 // this is only here to select the width / height of the window if not running fullscreen
41 // this is only here to select the width / height of the window if not running fullscreen
43 property bool tablet: false
42 property bool tablet: false
@@ -78,9 +77,6 @@ FocusScope {
78 // FIXME: if application focused before shell starts, shell draws on top of it only.
77 // FIXME: if application focused before shell starts, shell draws on top of it only.
79 // We should detect already running applications on shell start and bring them to the front.
78 // We should detect already running applications on shell start and bring them to the front.
80 applicationManager.unfocusCurrentApplication();
79 applicationManager.unfocusCurrentApplication();
81−
82− applicationManager.setMainStageAppRect(mainStageAppRect);
83− applicationManager.setSideStageAppRect(sideStageAppRect);
84 }
80 }
85
81
86 // Used for autopilot testing.
82 // Used for autopilot testing.
@@ -413,26 +409,6 @@ FocusScope {
413 orientation: Qt.Horizontal
409 orientation: Qt.Horizontal
414 }
410 }
415
411
416− // Defines the rectangle occupied by an application on the main or side stage.
417− // Used only to inform the ApplicationManager. Can be removed when the proper
418− // architecture is in place (unity8 as mir compositor).
419− Item {
420− id: mainStageAppRect
421− x: mainStage.x
422− y: mainStage.y + mainStage.normalApplicationY
423− width: mainStage.width
424− height: mainStage.height
425− visible: false; enabled: false
426− }
427− Item {
428− id: sideStageAppRect
429− x: sideStageRevealer.openedValue
430− y: sideStage.y + sideStage.normalApplicationY
431− width: sideStage.width
432− height: sideStage.height
433− visible: false; enabled: false
434− }
435−
436 DragHandle {
412 DragHandle {
437 id: stagesDragHandle
413 id: stagesDragHandle
438
414
@@ -825,6 +801,21 @@ FocusScope {
825 value: "unity8"
801 value: "unity8"
826 }
802 }
827
803
804+ OSKController {
805+ anchors.topMargin: panel.panelHeight
806+ anchors.fill: parent // as needs to know the geometry of the shell
807+ }
808+
809+ //FIXME: This should be handled in the input stack, keyboard shouldnt propagate
810+ MouseArea {
811+ anchors.bottom: parent.bottom
812+ anchors.left: parent.left
813+ anchors.right: parent.right
814+ height: shell.applicationManager ? shell.applicationManager.keyboardHeight : 0
815+
816+ enabled: shell.applicationManager && shell.applicationManager.keyboardVisible
817+ }
818+
828 Label {
819 Label {
829 anchors.centerIn: parent
820 anchors.centerIn: parent
830 visible: applicationManager.fake
821 visible: applicationManager.fake
qml/ShellOrientator.qmldeleted−43
@@ -1,43 +0,0 @@
1−/*
2− * Copyright (C) 2014 Canonical, Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU General Public License for more details.
12− *
13− * You should have received a copy of the GNU General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− */
16−
17−import QtQuick 2.0
18−import QtQuick.Window 2.0
19−import Unity.Application 0.1
20−
21−Item {
22− id: orientator
23−
24− // this is only here to select the width / height of the window if not running fullscreen
25− property bool tablet: false
26− width: tablet ? units.gu(160) : applicationArguments.hasGeometry() ? applicationArguments.width() : units.gu(40)
27− height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
28−
29− Item {
30− anchors.fill: parent
31− rotation: Screen.angleBetween(nativeOrientation, Screen.primaryOrientation)
32− Shell {
33− x: (parent.rotation == 0) ? 0 : (parent.width - parent.height) / 2
34− y: (parent.rotation == 0) ? 0 : -(parent.width - parent.height) / 2
35− width: (parent.rotation == 0) ? parent.width : parent.height
36− height: (parent.rotation == 0) ? parent.height : parent.width
37− }
38− }
39−
40− OSKController {
41− anchors.fill: parent // as needs to know the geometry of the shell
42− }
43−}
src/main.cpp+1−11
@@ -98,16 +98,6 @@ int startShell(int argc, const char** argv, void* server)
98 view->setFlags(Qt::FramelessWindowHint);
98 view->setFlags(Qt::FramelessWindowHint);
99 }
99 }
100
100
101− const QByteArray orientation = qgetenv("NATIVE_ORIENTATION");
102− Qt::ScreenOrientation orientationAngle = Qt::PrimaryOrientation;
103− if (orientation == "landscape") {
104− orientationAngle = Qt::LandscapeOrientation;
105− } else if (!orientation.isEmpty() && orientation != "portrait") {
106− qDebug() << "Unknown NATIVE_ORIENTATION setting, ignoring";
107− }
108−
109− view->rootContext()->setContextProperty("nativeOrientation", orientationAngle);
110−
111 // You will need this if you want to interact with touch-only components using a mouse
101 // You will need this if you want to interact with touch-only components using a mouse
112 // Needed only when manually testing on a desktop.
102 // Needed only when manually testing on a desktop.
113 MouseTouchAdaptor *mouseTouchAdaptor = 0;
103 MouseTouchAdaptor *mouseTouchAdaptor = 0;
@@ -125,7 +115,7 @@ int startShell(int argc, const char** argv, void* server)
125 nativeInterface->setProperty("ubuntuSessionType", 1);
115 nativeInterface->setProperty("ubuntuSessionType", 1);
126 view->setProperty("role", 2); // INDICATOR_ACTOR_ROLE
116 view->setProperty("role", 2); // INDICATOR_ACTOR_ROLE
127
117
128− QUrl source(::qmlDirectory()+"ShellOrientator.qml");
118+ QUrl source(::qmlDirectory()+"Shell.qml");
129 prependImportPaths(view->engine(), ::overrideImportPaths());
119 prependImportPaths(view->engine(), ::overrideImportPaths());
130 appendImportPaths(view->engine(), ::fallbackImportPaths());
120 appendImportPaths(view->engine(), ::fallbackImportPaths());
131
121