summaryrefslogtreecommitdiff
path: root/src/main-lib/main.cpp
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@pelagicore.com>2019-06-05 18:06:43 +0200
committerRobert Griebl <robert.griebl@pelagicore.com>2019-06-05 18:08:26 +0200
commit263f07c7606f89e9dc5a5c9523fcce4504c99005 (patch)
tree5518ad122174896610c501975ab411966e9b8ec9 /src/main-lib/main.cpp
parent65fd0ce4fa6599021ec28a0101c0f5358fe0e76c (diff)
downloadqtapplicationmanager-263f07c7606f89e9dc5a5c9523fcce4504c99005.tar.gz
Revert "Enable hardware OpenGL acceleration for Wayland clients"
This reverts commit 892394670ec2201ce24ee69e371419d98b8eb36e. The idea is sound, but it currently breaks on too many platforms right now: especially older distros (e.g. Ubuntu 16.04) and VMs (e.g. VMWare Player, even with up-to-date Mesa drivers). Change-Id: Ia853886e623781b09a079faa20c65c4feb1e91a8 Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com> Reviewed-by: Egor Nemtsev <enemtsev@luxoft.com>
Diffstat (limited to 'src/main-lib/main.cpp')
-rw-r--r--src/main-lib/main.cpp31
1 files changed, 1 insertions, 30 deletions
diff --git a/src/main-lib/main.cpp b/src/main-lib/main.cpp
index 3f87bed3..792f1da8 100644
--- a/src/main-lib/main.cpp
+++ b/src/main-lib/main.cpp
@@ -108,9 +108,6 @@
#if defined(AM_MULTI_PROCESS)
# include "processcontainer.h"
# include "nativeruntime.h"
-# if defined(Q_OS_LINUX)
-# include "sysfsreader.h"
-# endif
#endif
#include "plugincontainer.h"
#include "notificationmanager.h"
@@ -157,7 +154,7 @@ QT_BEGIN_NAMESPACE_AM
// The QGuiApplication constructor
Main::Main(int &argc, char **argv)
- : MainBase(Main::preConstructor(argc), argv)
+ : MainBase(SharedMain::preConstructor(argc), argv)
, SharedMain()
{
// this might be needed later on by the native runtime to find a suitable qml runtime launcher
@@ -196,32 +193,6 @@ Main::~Main()
delete StartupTimer::instance();
}
-// We need to do some things BEFORE the Q*Application constructor runs, so we're using this
-// old trick to do this hooking transparently for the user of the class.
-int &Main::preConstructor(int &argc)
-{
- SharedMain::preConstructor(argc);
-
-#if defined(AM_MULTI_PROCESS) && defined(Q_OS_LINUX) && !defined(AM_CROSS_COMPILED)
- // Check if we are running with a propietary NVIDIA driver: if not, we can enable the
- // new "linux-dmabuf" Wayland buffer extension, which will enable hardware accelerated
- // OpenGL for Wayland clients, even when running the compositor as an X11 client.
-
- SysFsReader modules("/proc/modules", 32768); // 32K should be plenty
- const QByteArray ba = modules.readValue();
- const int pos = ba.indexOf("nvidia");
- if ((pos < 0) || ((pos > 0) && ba.at(pos - 1) != '\n')) { // not found or not at start of line
- // only set linux-dmabuf, if the user doesn't force something else
- if (!qEnvironmentVariableIsSet("QT_WAYLAND_CLIENT_BUFFER_INTEGRATION")
- && !qEnvironmentVariableIsSet("QT_XCB_GL_INTEGRATION")) {
- qputenv("QT_WAYLAND_CLIENT_BUFFER_INTEGRATION", "linux-dmabuf-unstable-v1");
- qputenv("QT_XCB_GL_INTEGRATION", "xcb_egl");
- }
- }
-#endif
- return argc;
-}
-
/*! \internal
The caller has to make sure that cfg will be available even after this function returns:
we will access the cfg object from delayed init functions via lambdas!