on xenial help sign in
Remove some unneeded profile management and fix apps appearing white by making color be transparent
commit9a5fa7b810c5c4af9bb05637058375b56cdf9d24 authorMichael Terry <michael.terry@canonical.com> dateFri 7 Mar 2014, 13:36 (13 years ago) parentb81b329
3 files changed+8−16
plugins/Unity/Indicators/indicatorsmanager.cpp−5 src/CMakeLists.txt+2−2 src/main.cpp+6−9
plugins/Unity/Indicators/indicatorsmanager.cpp−5
@@ -26,7 +26,6 @@
2626
2727#include <paths.h>
2828
29−const QString default_profile = "phone";
3029
3130class IndicatorsManager::IndicatorData
3231{
@@ -299,10 +298,6 @@ Indicator::Ptr IndicatorsManager::indicator(const QString& indicator_name)
299298 return data->m_indicator;
300299 }
301300
302− QString profile = qgetenv("UNITY8_INDICATOR_PROFILE");
303− if (profile.isEmpty())
304− profile = default_profile;
305−
306301 Indicator::Ptr new_indicator(new Indicator(this));
307302 data->m_indicator = new_indicator;
308303 QSettings settings(data->m_fileInfo.absoluteFilePath(), QSettings::IniFormat, this);
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 "UNITY8_SHELL=1;INDICATOR_PROFILE=\"phone\""
28+ COMPILE_DEFINITIONS "UNITY8_GREETER=0"
2929 )
3030set_target_properties(${GREETER_APP} PROPERTIES
31− COMPILE_DEFINITIONS "UNITY8_SHELL=0;INDICATOR_PROFILE=\"phone_greeter\""
31+ COMPILE_DEFINITIONS "UNITY8_GREETER=1"
3232 )
3333
3434qt5_use_modules(${SHELL_APP} Gui Qml Quick Test)
src/main.cpp+6−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(UNITY8_SHELL ? "Unity 8" : "Unity 8 Greeter");
45+ QGuiApplication::setApplicationName(UNITY8_GREETER ? "Unity 8 Greeter" : "Unity 8");
4646 QGuiApplication *application;
4747 if (isUbuntuMirServer) {
4848 QLibrary unityMir("unity-mir", 1);
@@ -62,7 +62,7 @@ int startShell(int argc, const char** argv, void* server)
6262
6363 QString indicatorProfile = qgetenv("UNITY_INDICATOR_PROFILE");
6464 if (indicatorProfile.isEmpty()) {
65− indicatorProfile = "phone";
65+ indicatorProfile = UNITY8_GREETER ? "phone_greeter" : "phone";
6666 }
6767
6868 resolveIconTheme();
@@ -89,9 +89,6 @@ int startShell(int argc, const char** argv, void* server)
8989
9090 bindtextdomain("unity8", translationDirectory().toUtf8().data());
9191
92− // Tell indicator plugin what profile to use
93− qputenv("UNITY8_INDICATOR_PROFILE", INDICATOR_PROFILE);
94−
9592 QQuickView* view = new QQuickView();
9693 view->setResizeMode(QQuickView::SizeRootObjectToView);
9794 view->setTitle("Qml Phone Shell");
@@ -119,7 +116,7 @@ int startShell(int argc, const char** argv, void* server)
119116 nativeInterface->setProperty("ubuntuSessionType", 1);
120117 view->setProperty("role", 2); // INDICATOR_ACTOR_ROLE
121118
122− QUrl source(::qmlDirectory() + (UNITY8_SHELL ? "Shell.qml" : "GreeterShell.qml"));
119+ QUrl source(::qmlDirectory() + (UNITY8_GREETER ? "GreeterShell.qml" : "Shell.qml"));
123120 prependImportPaths(view->engine(), ::overrideImportPaths());
124121 appendImportPaths(view->engine(), ::fallbackImportPaths());
125122
@@ -128,16 +125,16 @@ int startShell(int argc, const char** argv, void* server)
128125 importPaths.replaceInStrings(QRegExp("qt5/imports$"), "qt5/imports/Unity-Mir");
129126 view->engine()->setImportPathList(importPaths);
130127
131−#if !UNITY8_SHELL
132− // Make background transparent, so that the greeter can bleed through.
128+#if UNITY8_GREETER
129+ // Add alpha to surface, so that the greeter can bleed through
133130 QSurfaceFormat format;
134131 format.setAlphaBufferSize(8);
135132 view->setFormat(format);
136− view->setColor(Qt::transparent);
137133#endif
138134 }
139135
140136 view->setSource(source);
137+ view->setColor(Qt::transparent);
141138
142139 if (qgetenv("QT_QPA_PLATFORM") == "ubuntu" || isUbuntuMirServer || args.contains(QLatin1String("-fullscreen"))) {
143140 // First, size window equal to screen (fake a real WM fullscreen mode).