Separate ForceDisable from LastCheckCrashed.

This commit is contained in:
John Preston 2024-05-27 17:53:54 +04:00
parent 7357b40ba1
commit a43143d01c
3 changed files with 4 additions and 8 deletions

View file

@ -383,7 +383,7 @@ void Application::run() {
}
SetCrashAnnotationsGL();
if (!Platform::IsMac() && Ui::GL::LastCrashCheckFailed()) {
if (Ui::GL::LastCrashCheckFailed()) {
showOpenGLCrashNotification();
}
@ -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();
@ -792,6 +790,7 @@ void Application::badMtprotoConfigurationError() {
}
void Application::startLocalStorage() {
Ui::GL::DetectLastCheckCrash();
Local::start();
_saveSettingsTimer.emplace([=] { saveSettings(); });
settings().saveDelayedRequests() | rpl::start_with_next([=] {

View file

@ -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) {

@ -1 +1 @@
Subproject commit 037ceb272c4dd2eb456e18b61e374c1fa759d109
Subproject commit b21a93f3ba47d6233a0feb764be37850ae1edcb2