Skip to content

Commit 360464f

Browse files
ilya-fedinjohn-preston
authored andcommitted
Uncomment making the context current in Ui::GL::CheckCapabilities
This should properly detect the NVIDIA X11 failure
1 parent 3fb4226 commit 360464f

File tree

2 files changed

+2
-28
lines changed

2 files changed

+2
-28
lines changed

ui/gl/gl_detection.cpp

+2-26
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include "ui/gl/gl_shader.h"
1010
#include "ui/integration.h"
1111
#include "base/debug_log.h"
12-
#include "base/options.h"
1312
#include "base/platform/base_platform_info.h"
1413

1514
#include <QtCore/QSet>
@@ -50,14 +49,6 @@ QList<QByteArray> EGLExtensions(not_null<QOpenGLContext*> context) {
5049
}
5150
#endif // DESKTOP_APP_USE_ANGLE
5251

53-
base::options::toggle AllowX11NvidiaOpenGL({
54-
.id = kOptionAllowX11NvidiaOpenGL,
55-
.name = "Allow OpenGL on the NVIDIA drivers (X11)",
56-
.description = "Qt+OpenGL have problems on X11 with NVIDIA drivers.",
57-
.scope = Platform::IsX11,
58-
.restartRequired = true,
59-
});
60-
6152
void CrashCheckStart() {
6253
auto f = QFile(Integration::Instance().openglCheckFilePath());
6354
if (f.open(QIODevice::WriteOnly)) {
@@ -68,8 +59,6 @@ void CrashCheckStart() {
6859

6960
} // namespace
7061

71-
const char kOptionAllowX11NvidiaOpenGL[] = "allow-linux-nvidia-opengl";
72-
7362
Capabilities CheckCapabilities(QWidget *widget) {
7463
if (!Platform::IsMac()) {
7564
if (ForceDisabled) {
@@ -111,9 +100,8 @@ Capabilities CheckCapabilities(QWidget *widget) {
111100

112101
const auto context = tester.context();
113102
if (!context
114-
|| !context->isValid()/*
115-
// This check doesn't work for a widget with WA_NativeWindow.
116-
|| !context->makeCurrent(tester.window()->windowHandle())*/) {
103+
|| !context->isValid()
104+
|| !context->makeCurrent(tester.window()->windowHandle())) {
117105
LOG_ONCE(("OpenGL: Could not create widget in a window."));
118106
return {};
119107
}
@@ -188,18 +176,6 @@ Capabilities CheckCapabilities(QWidget *widget) {
188176
LOG(("EGL Extensions: %1").arg(egllist.join(", ")));
189177
#endif // DESKTOP_APP_USE_ANGLE
190178

191-
if (::Platform::IsX11()
192-
&& version
193-
&& QByteArray(version).contains("NVIDIA")) {
194-
// https://github.com/telegramdesktop/tdesktop/issues/16830
195-
if (AllowX11NvidiaOpenGL.value()) {
196-
LOG_ONCE(("OpenGL: Allow on NVIDIA driver (experimental)."));
197-
} else {
198-
LOG_ONCE(("OpenGL: Disable on NVIDIA driver on X11."));
199-
return false;
200-
}
201-
}
202-
203179
return true;
204180
}();
205181
if (!checkVendor) {

ui/gl/gl_detection.h

-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ class QOpenGLContext;
1717

1818
namespace Ui::GL {
1919

20-
extern const char kOptionAllowX11NvidiaOpenGL[];
21-
2220
enum class Backend {
2321
Raster,
2422
OpenGL,

0 commit comments

Comments
 (0)