From c5718678ea9ffb7e82c8c3d19e36b4a9080965f7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 10 Aug 2023 14:37:55 +0200 Subject: [PATCH] Disable OpenGL ANGLE backend. Currently ANGLE can work through desktop OpenGL only with enabled attribute EGL_SURFACE_ORIENTATION_INVERT_Y_ANGLE. Qt can't work with it enabled and shows vertically flipped content. --- Telegram/SourceFiles/core/application.cpp | 2 +- .../SourceFiles/settings/settings_advanced.cpp | 15 ++++++++------- Telegram/lib_ui | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Telegram/SourceFiles/core/application.cpp b/Telegram/SourceFiles/core/application.cpp index 6ac6a20b8..104d887c2 100644 --- a/Telegram/SourceFiles/core/application.cpp +++ b/Telegram/SourceFiles/core/application.cpp @@ -123,7 +123,7 @@ void SetCrashAnnotationsGL() { case Ui::GL::ANGLE::D3D11: return "Direct3D 11"; case Ui::GL::ANGLE::D3D9: return "Direct3D 9"; case Ui::GL::ANGLE::D3D11on12: return "D3D11on12"; - case Ui::GL::ANGLE::OpenGL: return "OpenGL"; + //case Ui::GL::ANGLE::OpenGL: return "OpenGL"; } Unexpected("Ui::GL::CurrentANGLE value in SetupANGLE."); }()); diff --git a/Telegram/SourceFiles/settings/settings_advanced.cpp b/Telegram/SourceFiles/settings/settings_advanced.cpp index 0cd7c485f..1829f92a2 100644 --- a/Telegram/SourceFiles/settings/settings_advanced.cpp +++ b/Telegram/SourceFiles/settings/settings_advanced.cpp @@ -737,18 +737,19 @@ void SetupANGLE( tr::lng_settings_angle_backend_d3d11(tr::now), tr::lng_settings_angle_backend_d3d9(tr::now), tr::lng_settings_angle_backend_d3d11on12(tr::now), - tr::lng_settings_angle_backend_opengl(tr::now), + //tr::lng_settings_angle_backend_opengl(tr::now), tr::lng_settings_angle_backend_disabled(tr::now), }; - const auto backendIndex = [] { + const auto disabled = int(options.size()) - 1; + const auto backendIndex = [=] { if (Core::App().settings().disableOpenGL()) { - return 5; + return disabled; } else switch (Ui::GL::CurrentANGLE()) { case ANGLE::Auto: return 0; case ANGLE::D3D11: return 1; case ANGLE::D3D9: return 2; case ANGLE::D3D11on12: return 3; - case ANGLE::OpenGL: return 4; + //case ANGLE::OpenGL: return 4; } Unexpected("Ui::GL::CurrentANGLE value in SetupANGLE."); }(); @@ -764,7 +765,7 @@ void SetupANGLE( return; } const auto confirmed = crl::guard(button, [=] { - const auto nowDisabled = (index == 5); + const auto nowDisabled = (index == disabled); if (!nowDisabled) { Ui::GL::ChangeANGLE([&] { switch (index) { @@ -772,12 +773,12 @@ void SetupANGLE( case 1: return ANGLE::D3D11; case 2: return ANGLE::D3D9; case 3: return ANGLE::D3D11on12; - case 4: return ANGLE::OpenGL; + //case 4: return ANGLE::OpenGL; } Unexpected("Index in SetupANGLE."); }()); } - const auto wasDisabled = (backendIndex == 5); + const auto wasDisabled = (backendIndex == disabled); if (nowDisabled != wasDisabled) { Core::App().settings().setDisableOpenGL(nowDisabled); Local::writeSettings(); diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 5f2e0a32b..b49ee81df 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 5f2e0a32b12df1468419b123ac8fb4bb17cf47cc +Subproject commit b49ee81df9d285d08ef6bf834c6e14c5064b4070