on xenial help sign in
Remove some unneeded profile management and fix apps appearing white by making color be transparent
9a5fa7bMichael Terry
plugins/Unity/Indicators/indicatorsmanager.cpp−5
@@ -26,7 +26,6 @@
26
26
27#include <paths.h>
27#include <paths.h>
28
28
29−const QString default_profile = "phone";
30
29
31class IndicatorsManager::IndicatorData
30class IndicatorsManager::IndicatorData
32{
31{
@@ -299,10 +298,6 @@ Indicator::Ptr IndicatorsManager::indicator(const QString& indicator_name)
299 return data->m_indicator;
298 return data->m_indicator;
300 }
299 }
301
300
302− QString profile = qgetenv("UNITY8_INDICATOR_PROFILE");
303− if (profile.isEmpty())
304− profile = default_profile;
305−
306 Indicator::Ptr new_indicator(new Indicator(this));
301 Indicator::Ptr new_indicator(new Indicator(this));
307 data->m_indicator = new_indicator;
302 data->m_indicator = new_indicator;
308 QSettings settings(data->m_fileInfo.absoluteFilePath(), QSettings::IniFormat, this);
303 QSettings settings(data->m_fileInfo.absoluteFilePath(), QSettings::IniFormat, this);
src/CMakeLists.txt+2−2
@@ -25,10 +25,10 @@ add_executable(${SHELL_APP} ${COMMON_SRCS})
25add_executable(${GREETER_APP} ${COMMON_SRCS})
25add_executable(${GREETER_APP} ${COMMON_SRCS})
26
26
27set_target_properties(${SHELL_APP} PROPERTIES
27set_target_properties(${SHELL_APP} PROPERTIES
28− COMPILE_DEFINITIONS "UNITY8_SHELL=1;INDICATOR_PROFILE=\"phone\""
28+ COMPILE_DEFINITIONS "UNITY8_GREETER=0"
29 )
29 )
30set_target_properties(${GREETER_APP} PROPERTIES
30set_target_properties(${GREETER_APP} PROPERTIES
31− COMPILE_DEFINITIONS "UNITY8_SHELL=0;INDICATOR_PROFILE=\"phone_greeter\""
31+ COMPILE_DEFINITIONS "UNITY8_GREETER=1"
32 )
32 )
33
33
34qt5_use_modules(${SHELL_APP} Gui Qml Quick Test)
34qt5_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)
42{
42{
43 const bool isUbuntuMirServer = qgetenv("QT_QPA_PLATFORM") == "ubuntumirserver";
43 const bool isUbuntuMirServer = qgetenv("QT_QPA_PLATFORM") == "ubuntumirserver";
44
44
45− QGuiApplication::setApplicationName(UNITY8_SHELL ? "Unity 8" : "Unity 8 Greeter");
45+ QGuiApplication::setApplicationName(UNITY8_GREETER ? "Unity 8 Greeter" : "Unity 8");
46 QGuiApplication *application;
46 QGuiApplication *application;
47 if (isUbuntuMirServer) {
47 if (isUbuntuMirServer) {
48 QLibrary unityMir("unity-mir", 1);
48 QLibrary unityMir("unity-mir", 1);
@@ -62,7 +62,7 @@ int startShell(int argc, const char** argv, void* server)
62
62
63 QString indicatorProfile = qgetenv("UNITY_INDICATOR_PROFILE");
63 QString indicatorProfile = qgetenv("UNITY_INDICATOR_PROFILE");
64 if (indicatorProfile.isEmpty()) {
64 if (indicatorProfile.isEmpty()) {
65− indicatorProfile = "phone";
65+ indicatorProfile = UNITY8_GREETER ? "phone_greeter" : "phone";
66 }
66 }
67
67
68 resolveIconTheme();
68 resolveIconTheme();
@@ -89,9 +89,6 @@ int startShell(int argc, const char** argv, void* server)
89
89
90 bindtextdomain("unity8", translationDirectory().toUtf8().data());
90 bindtextdomain("unity8", translationDirectory().toUtf8().data());
91
91
92− // Tell indicator plugin what profile to use
93− qputenv("UNITY8_INDICATOR_PROFILE", INDICATOR_PROFILE);
94−
95 QQuickView* view = new QQuickView();
92 QQuickView* view = new QQuickView();
96 view->setResizeMode(QQuickView::SizeRootObjectToView);
93 view->setResizeMode(QQuickView::SizeRootObjectToView);
97 view->setTitle("Qml Phone Shell");
94 view->setTitle("Qml Phone Shell");
@@ -119,7 +116,7 @@ int startShell(int argc, const char** argv, void* server)
119 nativeInterface->setProperty("ubuntuSessionType", 1);
116 nativeInterface->setProperty("ubuntuSessionType", 1);
120 view->setProperty("role", 2); // INDICATOR_ACTOR_ROLE
117 view->setProperty("role", 2); // INDICATOR_ACTOR_ROLE
121
118
122− QUrl source(::qmlDirectory() + (UNITY8_SHELL ? "Shell.qml" : "GreeterShell.qml"));
119+ QUrl source(::qmlDirectory() + (UNITY8_GREETER ? "GreeterShell.qml" : "Shell.qml"));
123 prependImportPaths(view->engine(), ::overrideImportPaths());
120 prependImportPaths(view->engine(), ::overrideImportPaths());
124 appendImportPaths(view->engine(), ::fallbackImportPaths());
121 appendImportPaths(view->engine(), ::fallbackImportPaths());
125
122
@@ -128,16 +125,16 @@ int startShell(int argc, const char** argv, void* server)
128 importPaths.replaceInStrings(QRegExp("qt5/imports$"), "qt5/imports/Unity-Mir");
125 importPaths.replaceInStrings(QRegExp("qt5/imports$"), "qt5/imports/Unity-Mir");
129 view->engine()->setImportPathList(importPaths);
126 view->engine()->setImportPathList(importPaths);
130
127
131−#if !UNITY8_SHELL
128+#if UNITY8_GREETER
132− // Make background transparent, so that the greeter can bleed through.
129+ // Add alpha to surface, so that the greeter can bleed through
133 QSurfaceFormat format;
130 QSurfaceFormat format;
134 format.setAlphaBufferSize(8);
131 format.setAlphaBufferSize(8);
135 view->setFormat(format);
132 view->setFormat(format);
136− view->setColor(Qt::transparent);
137#endif
133#endif
138 }
134 }
139
135
140 view->setSource(source);
136 view->setSource(source);
137+ view->setColor(Qt::transparent);
141
138
142 if (qgetenv("QT_QPA_PLATFORM") == "ubuntu" || isUbuntuMirServer || args.contains(QLatin1String("-fullscreen"))) {
139 if (qgetenv("QT_QPA_PLATFORM") == "ubuntu" || isUbuntuMirServer || args.contains(QLatin1String("-fullscreen"))) {
143 // First, size window equal to screen (fake a real WM fullscreen mode).
140 // First, size window equal to screen (fake a real WM fullscreen mode).