Skip to content

Commit 4c426cd

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 9b323a1 commit 4c426cd

2 files changed

Lines changed: 2 additions & 28 deletions

File tree

ui/gl/gl_detection.cpp

Lines changed: 2 additions & 26 deletions
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>
@@ -37,14 +36,6 @@ bool LastCheckCrashed/* = false*/;
3736
ANGLE ResolvedANGLE/* = ANGLE::Auto*/;
3837
#endif // Q_OS_WIN
3938

40-
base::options::toggle AllowX11NvidiaOpenGL({
41-
.id = kOptionAllowX11NvidiaOpenGL,
42-
.name = "Allow OpenGL on the NVIDIA drivers (X11)",
43-
.description = "Qt+OpenGL have problems on X11 with NVIDIA drivers.",
44-
.scope = Platform::IsX11,
45-
.restartRequired = true,
46-
});
47-
4839
void CrashCheckStart() {
4940
auto f = QFile(Integration::Instance().openglCheckFilePath());
5041
if (f.open(QIODevice::WriteOnly)) {
@@ -55,8 +46,6 @@ void CrashCheckStart() {
5546

5647
} // namespace
5748

58-
const char kOptionAllowX11NvidiaOpenGL[] = "allow-linux-nvidia-opengl";
59-
6049
Capabilities CheckCapabilities(QWidget *widget) {
6150
if (!Platform::IsMac()) {
6251
if (ForceDisabled) {
@@ -98,9 +87,8 @@ Capabilities CheckCapabilities(QWidget *widget) {
9887

9988
const auto context = tester.context();
10089
if (!context
101-
|| !context->isValid()/*
102-
// This check doesn't work for a widget with WA_NativeWindow.
103-
|| !context->makeCurrent(tester.window()->windowHandle())*/) {
90+
|| !context->isValid()
91+
|| !context->makeCurrent(tester.window()->windowHandle())) {
10492
LOG_ONCE(("OpenGL: Could not create widget in a window."));
10593
return {};
10694
}
@@ -175,18 +163,6 @@ Capabilities CheckCapabilities(QWidget *widget) {
175163
LOG(("EGL Extensions: %1").arg(egllist.join(", ")));
176164
#endif // Q_OS_WIN
177165

178-
if (::Platform::IsX11()
179-
&& version
180-
&& QByteArray(version).contains("NVIDIA")) {
181-
// https://github.com/telegramdesktop/tdesktop/issues/16830
182-
if (AllowX11NvidiaOpenGL.value()) {
183-
LOG_ONCE(("OpenGL: Allow on NVIDIA driver (experimental)."));
184-
} else {
185-
LOG_ONCE(("OpenGL: Disable on NVIDIA driver on X11."));
186-
return false;
187-
}
188-
}
189-
190166
return true;
191167
}();
192168
if (!checkVendor) {

ui/gl/gl_detection.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ class QOpenGLContext;
1212

1313
namespace Ui::GL {
1414

15-
extern const char kOptionAllowX11NvidiaOpenGL[];
16-
1715
enum class Backend {
1816
Raster,
1917
OpenGL,

0 commit comments

Comments
 (0)