@@ -92,6 +92,16 @@ int startShell(int argc, const char** argv, void* server)
9292 view->setFlags(Qt::FramelessWindowHint);
9393 }
9494
95+ const QByteArray orientation = qgetenv("NATIVE_ORIENTATION");
96+ Qt::ScreenOrientation orientationAngle = Qt::PortraitOrientation;
97+ if (orientation == "landscape") {
98+ orientationAngle = Qt::LandscapeOrientation;
99+ } else if (!orientation.isEmpty() && orientation != "portrait") {
100+ qDebug() << "Unknown NATIVE_ORIENTATION setting, ignoring";
101+ }
102+
103+ view->rootContext()->setContextProperty("nativeOrientation", orientationAngle);
104+
95105 // You will need this if you want to interact with touch-only components using a mouse
96106 // Needed only when manually testing on a desktop.
97107 MouseTouchAdaptor *mouseTouchAdaptor = 0;
@@ -109,7 +119,7 @@ int startShell(int argc, const char** argv, void* server)
109119 nativeInterface->setProperty("ubuntuSessionType", 1);
110120 view->setProperty("role", 2); // INDICATOR_ACTOR_ROLE
111121
112− QUrl source(::qmlDirectory()+"Shell.qml");
122+ QUrl source(::qmlDirectory()+"ShellOrientator.qml");
113123 prependImportPaths(view->engine(), ::overrideImportPaths());
114124 appendImportPaths(view->engine(), ::fallbackImportPaths());
115125