mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Clear macOS notifications in a separate thread.
Sometimes NSUserNotificationCenter -deliveredNotifications method call freezes for a long time, so now we use it only in a separate thread and we group all the requests for clearing while another clearing is done.
This commit is contained in:
@@ -587,7 +587,6 @@ namespace Global {
|
||||
namespace internal {
|
||||
|
||||
struct Data {
|
||||
uint64 LaunchId = 0;
|
||||
SingleQueuedInvokation HandleHistoryUpdate = { [] { App::app()->call_handleHistoryUpdate(); } };
|
||||
SingleQueuedInvokation HandleUnreadCounterUpdate = { [] { App::app()->call_handleUnreadCounterUpdate(); } };
|
||||
SingleQueuedInvokation HandleDelayedPeerUpdates = { [] { App::app()->call_handleDelayedPeerUpdates(); } };
|
||||
@@ -697,8 +696,6 @@ bool started() {
|
||||
|
||||
void start() {
|
||||
GlobalData = new internal::Data();
|
||||
|
||||
memset_rand(&GlobalData->LaunchId, sizeof(GlobalData->LaunchId));
|
||||
}
|
||||
|
||||
void finish() {
|
||||
@@ -706,7 +703,6 @@ void finish() {
|
||||
GlobalData = nullptr;
|
||||
}
|
||||
|
||||
DefineReadOnlyVar(Global, uint64, LaunchId);
|
||||
DefineRefVar(Global, SingleQueuedInvokation, HandleHistoryUpdate);
|
||||
DefineRefVar(Global, SingleQueuedInvokation, HandleUnreadCounterUpdate);
|
||||
DefineRefVar(Global, SingleQueuedInvokation, HandleDelayedPeerUpdates);
|
||||
|
Reference in New Issue
Block a user