sindresorhus/KeyboardShortcuts

Warning message in Xcode output pane

mattgreen opened this issue · 2 comments

Thank you for one of many awesome repos!

I am using SwiftUI in a menubar app and have a KeyboardShortcuts.Recorder in a preference pane using your Preferences library. I can't tell if this is actually an issue or not; I haven't been able to nail down when it prints it, much less why. Maybe you have an idea?

2023-04-01 10:20:45.374012-0400 MyApp[57081:1875366] [General] ERROR: Setting <_TtCO17KeyboardShortcuts17KeyboardShortcuts13RecorderCocoa: 0x7fe850b76df0> as the first responder for window <Preferences.UserInteractionPausableWindow: 0x7fe84f70f8d0>, but it is in a different window ((null))! This would eventually crash when the view is freed. The first responder will be set to nil.

0   AppKit                              0x00007ff80e26a7b1 -[NSWindow _validateFirstResponder:] + 436
1   AppKit                              0x00007ff80e26a5b8 -[NSWindow _setFirstResponder:] + 31
2   AppKit                              0x00007ff80e3751aa -[NSWindow _realMakeFirstResponder:] + 313
3   AppKit                              0x00007ff80e3869c4 -[NSWindow _selectFirstKeyView] + 765
4   AppKit                              0x00007ff80e386036 -[NSWindow _setUpFirstResponder] + 215
5   AppKit                              0x00007ff80e383904 -[NSWindow _doWindowWillBeVisibleAsSheet:] + 153
6   AppKit                              0x00007ff80eba3752 -[NSWindow _reallyDoOrderWindowAboveOrBelow:] + 1338
7   AppKit                              0x00007ff80eba43b4 -[NSWindow _reallyDoOrderWindow:] + 99
8   AppKit                              0x00007ff80eba462a -[NSWindow _doOrderWindow:] + 295
9   AppKit                              0x00007ff80e377006 -[NSWindow makeKeyAndOrderFront:] + 47
10  QuickLookUI                         0x00007ffa28bc25ba -[QLSeamlessDocumentOpener showWindow:contentFrame:withBlock:] + 169
11  AppKit                              0x00007ff80e479c5f -[NSWindowController showWindow:] + 672
12  MyApp                               0x00000001027b3e7a $s11Preferences24SettingsWindowControllerC4show14preferencePaneyAA0B0O0G10IdentifierVSg_tF + 298
13  MyApp                               0x0000000102730ebe $s5MyApp0A3AppC12showSettingsyyF + 46
14  MyApp                               0x00000001027198f6 $s5MyApp11AppDelegateC12showSettings33_B5984D5EE29125152D0DF63365273F15LLyyF + 102
15  MyApp                               0x000000010271993c $s5MyApp11AppDelegateC12showSettings33_B5984D5EE29125152D0DF63365273F15LLyyFTo + 28
16  AppKit                              0x00007ff80e44b862 -[NSApplication(NSResponder) sendAction:to:from:] + 323
17  AppKit                              0x00007ff80e53c28b -[NSMenuItem _corePerformAction] + 413
18  AppKit                              0x00007ff80e53bf99 -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 142
19  AppKit                              0x00007ff80e5847ca -[NSMenu performActionForItemAtIndex:] + 113
20  AppKit                              0x00007ff80e584750 -[NSMenu _internalPerformActionForItemAtIndex:] + 82
21  AppKit                              0x00007ff80e584599 -[NSCarbonMenuImpl _carbonCommandProcessEvent:handlerCallRef:] + 101
22  AppKit                              0x00007ff80e520c20 NSSLMMenuEventHandler + 1015
23  HIToolbox                           0x00007ff814a2d48d _ZL23DispatchEventToHandlersP14EventTargetRecP14OpaqueEventRefP14HandlerCallRec + 1381
24  HIToolbox                           0x00007ff814a2c8cc _ZL30SendEventToEventTargetInternalP14OpaqueEventRefP20OpaqueEventTargetRefP14HandlerCallRec + 333
25  HIToolbox                           0x00007ff814a41529 SendEventToEventTarget + 39
26  HIToolbox                           0x00007ff814a9ed55 _ZL18SendHICommandEventjPK9HICommandjjhPKvP20OpaqueEventTargetRefS5_PP14OpaqueEventRef + 361
27  HIToolbox                           0x00007ff814ac3d47 SendMenuCommandWithContextAndModifiers + 46
28  HIToolbox                           0x00007ff814ac3ce6 SendMenuItemSelectedEvent + 344
29  HIToolbox                           0x00007ff814ac3b3d _ZL19FinishMenuSelectionP13SelectionDataP10MenuResultS2_ + 96
30  HIToolbox                           0x00007ff814bd2f91 _ZL19PopUpMenuSelectCoreP8MenuData5PointdS1_tjjPK4RecttjS4_S4_PK14__CFDictionaryPK10__CFStringPP13OpaqueMenuRefPt + 2105
31  HIToolbox                           0x00007ff814bd2275 _ZL26_HandlePopUpMenuSelection8P13OpaqueMenuRefP14OpaqueEventRefj5PointtjjPK4RecttS6_S6_PK14__CFDictionaryPK10__CFStringPS0_Pt + 410
32  HIToolbox                           0x00007ff814aa6815 _HandlePopUpMenuSelectionWithDictionary + 329
33  AppKit                              0x00007ff80e6fb8fc SLMPerformPopUpCarbonMenu + 2217
34  AppKit                              0x00007ff80e6f5ca2 _NSSLMPopUpCarbonMenu4 + 1346
35  AppKit                              0x00007ff80e6f574e -[NSCarbonMenuImpl popUpMenu:atLocation:width:view:selectedItemIndexProvider:font:flags:options:] + 462
36  AppKit                              0x00007ff80e57dd10 -[NSCarbonMenuImpl popUpMenu:atLocation:width:forView:withSelectedItem:withFont:withFlags:withOptions:] + 81
37  AppKit                              0x00007ff80ea190ed +[NSStatusBarButtonCell popupStatusBarMenu:ofItem:ofBar:inRect:ofView:withEvent:] + 415
38  AppKit                              0x00007ff80ea185f0 -[NSStatusBarButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 413
39  AppKit                              0x00007ff80e446eb4 -[NSControl mouseDown:] + 659
40  AppKit                              0x00007ff80e4453a2 -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 4283
41  AppKit                              0x00007ff80e3bb58e -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 2595
42  AppKit                              0x00007ff80e3ba94f -[NSWindow(NSEventRouting) sendEvent:] + 345
43  AppKit                              0x00007ff80ea1a980 -[NSStatusBarWindow sendEvent:] + 618
44  AppKit                              0x00007ff80e3b8cbe -[NSApplication(NSEvent) sendEvent:] + 358
45  AppKit                              0x00007ff80e677665 -[NSApplication _handleEvent:] + 65
46  AppKit                              0x00007ff80e2477dc -[NSApplication run] + 623
47  AppKit                              0x00007ff80e21b7f7 NSApplicationMain + 817
48  SwiftUI                             0x00007ff912bc3835 block_destroy_helper.121 + 13551
49  SwiftUI                             0x00007ff913c0f4f4 __swift_memcpy28_8 + 16452
50  SwiftUI                             0x00007ff9134cf28f block_destroy_helper.68 + 71219
51  MyApp                               0x000000010273114f $s5MyApp0A3AppC5$mainyyFZ + 47
52  MyApp                               0x0000000102731358 main + 24
53  dyld                                0x00007ff80acf9310 start + 2432

Me too

Me too.