Disable global hotkeys again for macOS < 15.0

Clearly, NSUserDefaults bindings were not really meant to be used in
practice at all, as they do nothing but crash the app.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
Christopher Snowhill 2025-03-09 14:23:59 -07:00
parent 6036000214
commit 05f2434462
2 changed files with 27 additions and 14 deletions

View file

@ -210,11 +210,13 @@ static BOOL consentLastEnabled = NO;
[randomizeButton setToolTip:NSLocalizedString(@"RandomizeButtonTooltip", @"")];
[fileButton setToolTip:NSLocalizedString(@"FileButtonTooltip", @"")];
[self registerDefaultHotKeys];
[self migrateHotKeys];
[self registerHotKeys];
if(@available(macOS 15, *)) {
[self registerDefaultHotKeys];
[self migrateHotKeys];
[self registerHotKeys];
}
(void)[spotlightWindowController init];

View file

@ -41,15 +41,26 @@
[[NSBundle bundleWithIdentifier:@"org.cogx.cog.preferences"] loadNibNamed:@"Preferences"
owner:plugin
topLevelObjects:nil];
return @[[plugin playlistPane],
[plugin hotKeyPane],
[plugin updatesPane],
[plugin outputPane],
[plugin generalPane],
[plugin notificationsPane],
[plugin appearancePane],
[plugin midiPane],
[plugin rubberbandPane]];
if(@available(macos 15, *)) {
return @[[plugin playlistPane],
[plugin hotKeyPane],
[plugin updatesPane],
[plugin outputPane],
[plugin generalPane],
[plugin notificationsPane],
[plugin appearancePane],
[plugin midiPane],
[plugin rubberbandPane]];
} else {
return @[[plugin playlistPane],
[plugin updatesPane],
[plugin outputPane],
[plugin generalPane],
[plugin notificationsPane],
[plugin appearancePane],
[plugin midiPane],
[plugin rubberbandPane]];
}
}
- (HotKeyPane *)hotKeyPane {