Post

Replies

Boosts

Views

Activity

Comment on Accessing Window Server and other GUI services when running tests via SSH vs LaunchAgent
I've since learned about launchctl asuser, which allows me to launch a process over SSH with an Aqua session, and with stdin/out/err attached: torarne@macos-15-5-0 % ./foo Session ID: 100044 sessionIsRoot: false sessionHasGraphicAccess: false sessionHasTTY: true sessionIsRemote: true ^C torarne@macos-15-5-0 % sudo launchctl asuser 501 ./foo Session ID: 100003 sessionIsRoot: false sessionHasGraphicAccess: true sessionHasTTY: true sessionIsRemote: false ^C
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’25
Comment on Local Network Access Permission requires binary to have LC_UUID load command
It's a reasonable bug, however, IMHO the "fix" here should be to reject the extension as invalid at load time. Executable need to include build UUIDs. Agreed. A clear indication up front (UI or warning/error in system logs or as detailed in the returned error in the network API layer) that the executable can't even ask for network permissions would have helped diagnose this.
Jul ’24
Comment on Key equivalent matching for non-US English keyboard layouts
The reason for the synthetic event not behaving the same as the real key event was that the synthetic event didn't have an eventRef, causing _matchesKeyEquivalent to bail out early. Calling syntheticEvent.eventRef (https://developer.apple.com/documentation/appkit/nsevent/1525143-eventref?language=objc) forces NSEvent to lazily create the eventRef.
Topic: UI Frameworks SubTopic: AppKit Tags:
Oct ’23
Comment on Key equivalent matching for non-US English keyboard layouts
Interestingly, [NSEvent _matchesKeyEquivalent:modifierMask:] returns YES for a real key event: NSEvent: type=KeyDown loc=(21.2695,-129.457) time=78998.2 flags=0x100108 win=0x13227f2c0 winNum=2566 ctxt=0x0 chars="c" unmodchars="ב" repeat=0 keyCode=8 But NO for a synthesized event via [NSEvent keyEventWithType] NSEvent: type=KeyDown loc=(0,0) time=0.0 flags=0x100000 win=0x0 winNum=0 ctxt=0x0 chars="c" unmodchars="ב" repeat=0 keyCode=8
Topic: UI Frameworks SubTopic: AppKit Tags:
May ’23
Comment on Balancing implicit startAccessingSecurityScopedResource
I posted two follow up questions here https://developer.apple.com/forums/thread/807374 and here https://developer.apple.com/forums/thread/80737 Thanks!
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’25
Comment on Balancing implicit startAccessingSecurityScopedResource
Thank you so much! 🙌🏻 And sorry for the delay in replying, have been down with a nasty cold 🤧
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’25
Comment on macOS26: MenuBarExtra item not showing
Thanks for your insights Kevin! I've added a standalone comment explaining Qt's use of NSApplication
Replies
Boosts
Views
Activity
Nov ’25
Comment on [NSEvent charactersByApplyingModifiers:] not matching NSEvent.characters/charactersIgnoringModifiers
Thanks Albert! See additional comment below.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Oct ’25
Comment on Accessing Window Server and other GUI services when running tests via SSH vs LaunchAgent
I've since learned about launchctl asuser, which allows me to launch a process over SSH with an Aqua session, and with stdin/out/err attached: torarne@macos-15-5-0 % ./foo Session ID: 100044 sessionIsRoot: false sessionHasGraphicAccess: false sessionHasTTY: true sessionIsRemote: true ^C torarne@macos-15-5-0 % sudo launchctl asuser 501 ./foo Session ID: 100003 sessionIsRoot: false sessionHasGraphicAccess: true sessionHasTTY: true sessionIsRemote: false ^C
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jun ’25
Comment on Debug View Hierarchy not showing Metal content
This seems to work now (in Xcode 16.4 at least)! Thanks to whoever fixed this! ❤️
Replies
Boosts
Views
Activity
Jun ’25
Comment on Supporting AdaptiveImageGlyph copying & pasting
You can create NSAdaptiveImageGlyphs for the emoji keyboard by turning photos into "stickers". As far as I can tell this uses the same underlying APIs for text as Genmojis will when released.
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’24
Comment on Local Network Access Permission requires binary to have LC_UUID load command
Agreed. A clear indication up front (UI or warning/error in system logs or as detailed in the returned error in the network API layer) that the executable can't even ask for network permissions would have helped diagnose this.
Replies
Boosts
Views
Activity
Jul ’24
Comment on Local Network Access Permission requires binary to have LC_UUID load command
It's a reasonable bug, however, IMHO the "fix" here should be to reject the extension as invalid at load time. Executable need to include build UUIDs. Agreed. A clear indication up front (UI or warning/error in system logs or as detailed in the returned error in the network API layer) that the executable can't even ask for network permissions would have helped diagnose this.
Replies
Boosts
Views
Activity
Jul ’24
Comment on Local Network Access Permission
Posted https://developer.apple.com/forums/thread/761001 tl;dr, golang doesn't produce LC_UUID, which is important for the network privacy subsystem
Replies
Boosts
Views
Activity
Jul ’24
Comment on Debug View Hierarchy not showing Metal content
Nice, that helps to see the properties! Unfortunately we use a CAMetalLayer in an NSView, not MTKView, so we're not seeing those properties shown in the screenshot above. Is there a way to drill down in the inspector from a NSView to its layer?
Replies
Boosts
Views
Activity
Jan ’24
Comment on Key equivalent matching for non-US English keyboard layouts
The reason for the synthetic event not behaving the same as the real key event was that the synthetic event didn't have an eventRef, causing _matchesKeyEquivalent to bail out early. Calling syntheticEvent.eventRef (https://developer.apple.com/documentation/appkit/nsevent/1525143-eventref?language=objc) forces NSEvent to lazily create the eventRef.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Oct ’23
Comment on Key equivalent matching for non-US English keyboard layouts
Please see additional replies below, thank you.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
May ’23
Comment on Key equivalent matching for non-US English keyboard layouts
The flags, location, time, window, and winNumber might affect this, or perhaps [NSEvent _matchesKeyEquivalent:modifierMask:] also looks at state outside of the arguments?
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
May ’23
Comment on Key equivalent matching for non-US English keyboard layouts
Interestingly, [NSEvent _matchesKeyEquivalent:modifierMask:] returns YES for a real key event: NSEvent: type=KeyDown loc=(21.2695,-129.457) time=78998.2 flags=0x100108 win=0x13227f2c0 winNum=2566 ctxt=0x0 chars="c" unmodchars="ב" repeat=0 keyCode=8 But NO for a synthesized event via [NSEvent keyEventWithType] NSEvent: type=KeyDown loc=(0,0) time=0.0 flags=0x100000 win=0x0 winNum=0 ctxt=0x0 chars="c" unmodchars="ב" repeat=0 keyCode=8
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
May ’23