mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Make DeadlockDetector an experimental setting.
This commit is contained in:
@@ -24,6 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "base/timer.h"
|
||||
#include "base/concurrent_timer.h"
|
||||
#include "base/invoke_queued.h"
|
||||
#include "base/options.h"
|
||||
#include "base/qthelp_url.h"
|
||||
#include "base/qthelp_regex.h"
|
||||
#include "ui/ui_utility.h"
|
||||
@@ -35,6 +36,18 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include <QtGui/qpa/qplatformscreen.h>
|
||||
|
||||
namespace Core {
|
||||
namespace {
|
||||
|
||||
base::options::toggle OptionDeadlockDetector({
|
||||
.id = kOptionDeadlockDetector,
|
||||
.name = "Deadlock Detector",
|
||||
.description = "Check once every 30 seconds that main thread is still responsive.",
|
||||
.restartRequired = true,
|
||||
});
|
||||
|
||||
} // namespace
|
||||
|
||||
const char kOptionDeadlockDetector[] = "deadlock-detector";
|
||||
|
||||
bool Sandbox::QuitOnStartRequested = false;
|
||||
|
||||
@@ -149,12 +162,10 @@ void Sandbox::launchApplication() {
|
||||
}
|
||||
setupScreenScale();
|
||||
|
||||
#ifndef _DEBUG
|
||||
if (Logs::DebugEnabled()) {
|
||||
if (OptionDeadlockDetector.value()) {
|
||||
using DeadlockDetector::PingThread;
|
||||
_deadlockDetector = std::make_unique<PingThread>(this);
|
||||
}
|
||||
#endif // !_DEBUG
|
||||
|
||||
_application = std::make_unique<Application>();
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ class QLockFile;
|
||||
|
||||
namespace Core {
|
||||
|
||||
extern const char kOptionDeadlockDetector[];
|
||||
|
||||
class UpdateChecker;
|
||||
class Application;
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "boxes/moderate_messages_box.h"
|
||||
#include "core/application.h"
|
||||
#include "core/launcher.h"
|
||||
#include "core/sandbox.h"
|
||||
#include "chat_helpers/tabbed_panel.h"
|
||||
#include "dialogs/dialogs_widget.h"
|
||||
#include "history/history_item_components.h"
|
||||
@@ -163,6 +164,7 @@ void SetupExperimental(
|
||||
addToggle(Window::Notifications::kOptionGNotification);
|
||||
addToggle(Core::kOptionFreeType);
|
||||
addToggle(Core::kOptionSkipUrlSchemeRegister);
|
||||
addToggle(Core::kOptionDeadlockDetector);
|
||||
addToggle(Data::kOptionExternalVideoPlayer);
|
||||
addToggle(Window::kOptionNewWindowsSizeAsFirst);
|
||||
addToggle(MTP::details::kOptionPreferIPv6);
|
||||
|
||||
@@ -71,7 +71,7 @@ using Core::WindowPosition;
|
||||
|
||||
base::options::toggle OptionNewWindowsSizeAsFirst({
|
||||
.id = kOptionNewWindowsSizeAsFirst,
|
||||
.name = "Adjust size of new chat windows.",
|
||||
.name = "Adjust size of new chat windows",
|
||||
.description = "Open new windows with a size of the main window.",
|
||||
});
|
||||
|
||||
|
||||
+1
-1
Submodule Telegram/lib_webview updated: 55ea117597...b4a0af279b
Reference in New Issue
Block a user