Skip to content

Commit

Permalink
Separate ForceDisable from LastCheckCrashed.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed May 27, 2024
1 parent 7357b40 commit a43143d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
5 changes: 2 additions & 3 deletions Telegram/SourceFiles/core/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ void Application::run() {
}

SetCrashAnnotationsGL();
if (!Platform::IsMac() && Ui::GL::LastCrashCheckFailed()) {
if (Ui::GL::LastCrashCheckFailed()) {
showOpenGLCrashNotification();
}

Expand Down Expand Up @@ -427,14 +427,12 @@ void Application::checkWindowAccount(not_null<Window::Controller*> window) {

void Application::showOpenGLCrashNotification() {
const auto enable = [=] {
Ui::GL::ForceDisable(false);
Ui::GL::CrashCheckFinish();
settings().setDisableOpenGL(false);
Local::writeSettings();
Restart();
};
const auto keepDisabled = [=](Fn<void()> close) {
Ui::GL::ForceDisable(true);
Ui::GL::CrashCheckFinish();
settings().setDisableOpenGL(true);
Local::writeSettings();
Expand Down Expand Up @@ -792,6 +790,7 @@ void Application::badMtprotoConfigurationError() {
}

void Application::startLocalStorage() {
Ui::GL::DetectLastCheckCrash();
Local::start();
_saveSettingsTimer.emplace([=] { saveSettings(); });
settings().saveDelayedRequests() | rpl::start_with_next([=] {
Expand Down
5 changes: 1 addition & 4 deletions Telegram/SourceFiles/core/core_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -910,10 +910,7 @@ void Settings::addFromSerialized(const QByteArray &serialized) {
_recentEmojiPreload = std::move(recentEmojiPreload);
_emojiVariants = std::move(emojiVariants);
_disableOpenGL = (disableOpenGL == 1);
if (!Platform::IsMac()) {
Ui::GL::ForceDisable(_disableOpenGL
|| Ui::GL::LastCrashCheckFailed());
}
Ui::GL::ForceDisable(_disableOpenGL);
_groupCallNoiseSuppression = (groupCallNoiseSuppression == 1);
const auto uncheckedWorkMode = static_cast<WorkMode>(workMode);
switch (uncheckedWorkMode) {
Expand Down

0 comments on commit a43143d

Please sign in to comment.