on xenial help sign in
Use setenv as early as possible to avoid setenv and getenv clashing in multi-threaded situations. Fixes: https://bugs.launchpad.net/bugs/1240866.
649b7ddMichał Sawicz
main.cpp+8−8
@@ -78,14 +78,6 @@ void resolveIconTheme() {
78
78
79int startShell(int argc, const char** argv, void* server)
79int startShell(int argc, const char** argv, void* server)
80{
80{
81− /* Workaround Qt platform integration plugin not advertising itself
82− as having the following capabilities:
83− - QPlatformIntegration::ThreadedOpenGL
84− - QPlatformIntegration::BufferQueueingOpenGL
85− */
86− setenv("QML_FORCE_THREADED_RENDERER", "1", 1);
87− setenv("QML_FIXED_ANIMATION_STEP", "1", 1);
88−
89 const bool isUbuntuMirServer = qgetenv("QT_QPA_PLATFORM") == "ubuntumirserver";
81 const bool isUbuntuMirServer = qgetenv("QT_QPA_PLATFORM") == "ubuntumirserver";
90
82
91 QGuiApplication::setApplicationName("Unity 8");
83 QGuiApplication::setApplicationName("Unity 8");
@@ -186,6 +178,14 @@ int startShell(int argc, const char** argv, void* server)
186
178
187int main(int argc, const char *argv[])
179int main(int argc, const char *argv[])
188{
180{
181+ /* Workaround Qt platform integration plugin not advertising itself
182+ as having the following capabilities:
183+ - QPlatformIntegration::ThreadedOpenGL
184+ - QPlatformIntegration::BufferQueueingOpenGL
185+ */
186+ setenv("QML_FORCE_THREADED_RENDERER", "1", 1);
187+ setenv("QML_FIXED_ANIMATION_STEP", "1", 1);
188+
189 // For ubuntumirserver/ubuntumirclient
189 // For ubuntumirserver/ubuntumirclient
190 if (qgetenv("QT_QPA_PLATFORM").startsWith("ubuntumir")) {
190 if (qgetenv("QT_QPA_PLATFORM").startsWith("ubuntumir")) {
191 setenv("QT_QPA_PLATFORM", "ubuntumirserver", 1);
191 setenv("QT_QPA_PLATFORM", "ubuntumirserver", 1);