mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-30 22:25:12 +00:00
Hook main queue processing to update requests.
This commit is contained in:
@@ -7,6 +7,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "platform/platform_specific.h"
|
||||
|
||||
#include <execinfo.h>
|
||||
#include <signal.h>
|
||||
|
||||
@@ -39,6 +41,10 @@ inline std::optional<crl::time> LastUserInputTime() {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
inline constexpr bool UseMainQueueGeneric() {
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Platform
|
||||
|
||||
inline QString psServerPrefix() {
|
||||
|
@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "platform/platform_specific.h"
|
||||
#include "platform/mac/specific_mac_p.h"
|
||||
|
||||
namespace Data {
|
||||
@@ -23,6 +24,10 @@ QString CurrentExecutablePath(int argc, char *argv[]);
|
||||
|
||||
void RemoveQuarantine(const QString &path);
|
||||
|
||||
inline constexpr bool UseMainQueueGeneric() {
|
||||
return false;
|
||||
}
|
||||
|
||||
namespace ThirdParty {
|
||||
|
||||
inline void start() {
|
||||
|
@@ -29,6 +29,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include <mach-o/dyld.h>
|
||||
#include <AVFoundation/AVFoundation.h>
|
||||
|
||||
extern "C" {
|
||||
void _dispatch_main_queue_callback_4CF(mach_msg_header_t *msg);
|
||||
} // extern "C"
|
||||
|
||||
namespace {
|
||||
|
||||
QStringList _initLogs;
|
||||
@@ -139,6 +143,10 @@ void RemoveQuarantine(const QString &path) {
|
||||
removexattr(local.data(), kQuarantineAttribute, 0);
|
||||
}
|
||||
|
||||
void DrainMainQueue() {
|
||||
_dispatch_main_queue_callback_4CF(nullptr);
|
||||
}
|
||||
|
||||
void RegisterCustomScheme() {
|
||||
#ifndef TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
|
||||
OSStatus result = LSSetDefaultHandlerForURLScheme(CFSTR("tg"), (CFStringRef)[[NSBundle mainBundle] bundleIdentifier]);
|
||||
|
@@ -45,6 +45,9 @@ bool OpenSystemSettings(SystemSettingsType type);
|
||||
return LastUserInputTime().has_value();
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr bool UseMainQueueGeneric();
|
||||
void DrainMainQueue(); // Needed only if UseMainQueueGeneric() is false.
|
||||
|
||||
namespace ThirdParty {
|
||||
|
||||
void start();
|
||||
|
@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "platform/platform_specific.h"
|
||||
#include "platform/win/wrapper_windows_h.h"
|
||||
|
||||
namespace Data {
|
||||
@@ -38,6 +39,10 @@ inline void ReInitOnTopPanel(QWidget *panel) {
|
||||
|
||||
QString CurrentExecutablePath(int argc, char *argv[]);
|
||||
|
||||
inline constexpr bool UseMainQueueGeneric() {
|
||||
return true;
|
||||
}
|
||||
|
||||
namespace ThirdParty {
|
||||
|
||||
void start();
|
||||
|
Reference in New Issue
Block a user