on xenial help sign in
Only make background transparent in greeter mode, in case it matters
commitb98b649a722cb62ecff1a11c4fc9361af127d8ca authorMichael Terry <michael.terry@canonical.com> dateThu 30 Jan 2014, 12:50 (13 years ago) parent86b6774
2 files changed+12−11
src/CMakeLists.txt+2−2 src/main.cpp+10−9
src/CMakeLists.txt+2−2
@@ -25,10 +25,10 @@ add_executable(${SHELL_APP} ${COMMON_SRCS})
2525add_executable(${GREETER_APP} ${COMMON_SRCS})
2626
2727set_target_properties(${SHELL_APP} PROPERTIES
28− COMPILE_DEFINITIONS "APP_NAME=\"Unity 8\";QML_FILE=\"Shell.qml\";INDICATOR_PROFILE=\"phone\""
28+ COMPILE_DEFINITIONS "UNITY8_SHELL=1;INDICATOR_PROFILE=\"phone\""
2929 )
3030set_target_properties(${GREETER_APP} PROPERTIES
31− COMPILE_DEFINITIONS "APP_NAME=\"Unity 8 Greeter\";QML_FILE=\"GreeterShell.qml\";INDICATOR_PROFILE=\"phone_greeter\""
31+ COMPILE_DEFINITIONS "UNITY8_SHELL=0;INDICATOR_PROFILE=\"phone_greeter\""
3232 )
3333
3434qt5_use_modules(${SHELL_APP} Gui Qml Quick Test)
src/main.cpp+10−9
@@ -42,7 +42,7 @@ int startShell(int argc, const char** argv, void* server)
4242{
4343 const bool isUbuntuMirServer = qgetenv("QT_QPA_PLATFORM") == "ubuntumirserver";
4444
45− QGuiApplication::setApplicationName(APP_NAME);
45+ QGuiApplication::setApplicationName(UNITY8_SHELL ? "Unity 8" : "Unity 8 Greeter");
4646 QGuiApplication *application;
4747 if (isUbuntuMirServer) {
4848 QLibrary unityMir("unity-mir", 1);
@@ -113,7 +113,7 @@ int startShell(int argc, const char** argv, void* server)
113113 nativeInterface->setProperty("ubuntuSessionType", 1);
114114 view->setProperty("role", 2); // INDICATOR_ACTOR_ROLE
115115
116− QUrl source(::qmlDirectory()+QML_FILE);
116+ QUrl source(::qmlDirectory() + (UNITY8_SHELL ? "Shell.qml" : "GreeterShell.qml"));
117117 prependImportPaths(view->engine(), ::overrideImportPaths());
118118 appendImportPaths(view->engine(), ::fallbackImportPaths());
119119
@@ -121,17 +121,18 @@ int startShell(int argc, const char** argv, void* server)
121121 QStringList importPaths = view->engine()->importPathList();
122122 importPaths.replaceInStrings(QRegExp("qt5/imports$"), "qt5/imports/Unity-Mir");
123123 view->engine()->setImportPathList(importPaths);
124+
125+#if !UNITY8_SHELL
126+ // Make background transparent, so that the greeter can bleed through.
127+ QSurfaceFormat format;
128+ format.setAlphaBufferSize(8);
129+ view->setFormat(format);
130+ view->setColor(Qt::transparent);
131+#endif
124132 }
125133
126134 view->setSource(source);
127135
128− // Make background transparent, so that the greeter can bleed through.
129− // In normal shell, the background is never seen.
130− QSurfaceFormat format;
131− format.setAlphaBufferSize(8);
132− view->setFormat(format);
133− view->setColor(Qt::transparent);
134−
135136 if (qgetenv("QT_QPA_PLATFORM") == "ubuntu" || isUbuntuMirServer || args.contains(QLatin1String("-fullscreen"))) {
136137 // First, size window equal to screen (fake a real WM fullscreen mode).
137138 // Then, in case we are actually running inside a windowing system,