mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 14:45:21 +00:00
Thanks @scottg, this is a better more generalized solution.
This commit is contained in:
@@ -2083,8 +2083,14 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock)
|
|||||||
[self setDisplaySuspended:NO];
|
[self setDisplaySuspended:NO];
|
||||||
} else {
|
} else {
|
||||||
[self setDisplaySuspended:YES];
|
[self setDisplaySuspended:YES];
|
||||||
|
//schedule clear contents on next runloop
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
ASDN::MutexLocker l(_propertyLock);
|
||||||
|
if (ASInterfaceStateIncludesDisplay(_interfaceState) == NO) {
|
||||||
[self clearContents];
|
[self clearContents];
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// NOTE: This case isn't currently supported as setInterfaceState: isn't exposed externally, and all
|
// NOTE: This case isn't currently supported as setInterfaceState: isn't exposed externally, and all
|
||||||
// internal use cases are range-managed. When a node is visible, don't mess with display - CA will start it.
|
// internal use cases are range-managed. When a node is visible, don't mess with display - CA will start it.
|
||||||
@@ -2095,8 +2101,14 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock)
|
|||||||
[ASDisplayNode scheduleNodeForRecursiveDisplay:self];
|
[ASDisplayNode scheduleNodeForRecursiveDisplay:self];
|
||||||
} else {
|
} else {
|
||||||
[[self asyncLayer] cancelAsyncDisplay];
|
[[self asyncLayer] cancelAsyncDisplay];
|
||||||
|
//schedule clear contents on next runloop
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
ASDN::MutexLocker l(_propertyLock);
|
||||||
|
if (ASInterfaceStateIncludesDisplay(_interfaceState) == NO) {
|
||||||
[self clearContents];
|
[self clearContents];
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user