mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-24 09:18:08 +02:00
Use __block rather than __weak since we are in manual ref counting regime
This commit is contained in:
@@ -453,8 +453,9 @@ GLFWAPI GLFWColorScheme glfwGetCurrentSystemColorTheme(bool query_if_unintialize
|
||||
if ([keyPath isEqualToString:@"effectiveAppearance"]) {
|
||||
// The initial call (from NSKeyValueObservingOptionInitial) might happen on a background thread.
|
||||
// Dispatch to the main thread to be safe, especially if updating UI.
|
||||
__block __typeof__(self) weakSelf = self;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self handleAppearanceChange];
|
||||
[weakSelf handleAppearanceChange];
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -2330,8 +2330,9 @@ void _glfwPlatformShowWindow(_GLFWwindow* window, bool move_to_active_screen)
|
||||
NSWindowCollectionBehavior old = nw.collectionBehavior;
|
||||
nw.collectionBehavior = (old & !NSWindowCollectionBehaviorCanJoinAllSpaces) | NSWindowCollectionBehaviorMoveToActiveSpace;
|
||||
[nw orderFront:nil];
|
||||
__block __typeof__(nw) weakSelf = nw;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
nw.collectionBehavior = old;
|
||||
weakSelf.collectionBehavior = old;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user