From 2b28cfd928b22c410c4ebccdce050a50d27da506 Mon Sep 17 00:00:00 2001 From: Andrew Kitchen Date: Sat, 22 Jun 2024 16:08:17 -0700 Subject: [PATCH] Try to ensure the About panel always renders the Quartz Composition Unsure if it's related to the ARC migration, but the app may crash opening or closing the About panel in a way which implicates Quartz internals. Explicitly retaining the About panel and QCView and being more gentle about restarting rendering seems to help. --- keycastr/KCAppController.m | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/keycastr/KCAppController.m b/keycastr/KCAppController.m index 282e72d..5ac0157 100644 --- a/keycastr/KCAppController.m +++ b/keycastr/KCAppController.m @@ -65,8 +65,8 @@ static NSInteger kKCPrefDisplayIconInDock = 0x02; @property (nonatomic, assign) KeyCombo toggleKeyCombo; @property (nonatomic, assign) IBOutlet NSMenu *statusMenu; -@property (nonatomic, assign) IBOutlet NSWindow *aboutWindow; -@property (nonatomic, assign) IBOutlet QCView *aboutQCView; +@property (nonatomic, strong) IBOutlet NSWindow *aboutWindow; +@property (nonatomic, strong) IBOutlet QCView *aboutQCView; @property (nonatomic, assign) IBOutlet NSWindow *preferencesWindow; @property (nonatomic, assign) IBOutlet KCPrefsWindowController *prefsWindowController; @property (nonatomic, assign) IBOutlet SRRecorderControl *shortcutRecorder; @@ -330,10 +330,14 @@ static NSInteger kKCPrefDisplayIconInDock = 0x02; -(void) orderFrontKeyCastrAboutPanel:(id)sender { - [aboutQCView startRendering]; - [aboutWindow center]; - [aboutWindow makeKeyAndOrderFront:sender]; - [NSApp activateIgnoringOtherApps:YES]; + [aboutWindow center]; + [aboutWindow makeKeyAndOrderFront:sender]; + + if (!aboutQCView.isRendering) { + [aboutQCView startRendering]; + } + + [NSApp activateIgnoringOtherApps:YES]; } -(void) orderFrontKeyCastrPreferencesPanel:(id)sender