Posts

Post not yet marked as solved
3 Replies
877 Views
Sonoma beta release notes mention that NSMenu was rewritten from scratch using AppKit, however, it seems like a lot of behavior was removed along the way which breaks applications. I've filed several requests using Feedback Assistant, but none of them were fixed in the 3 following betas. FB12867496: NSMenu no longer receives keyboard events from GetEventDispatcherTarget (there is a workaround) FB12867573: NSMenuItem custom view window is nil FB12887219 : NSMenu performSelector highlightItem doesn't highlight menu item FB12938907: NSMenu not properly updated when adding/removing NSMenuItem I wonder if anyone else has experienced similar problems and can share workarounds for them:
Posted
by p0deje.
Last updated
.
Post not yet marked as solved
0 Replies
283 Views
Is there any modern example of how to create a sandboxed application that provides a spelling service to other macOS applications? The example out there are all in Objective-C and doesn't work when run in modern Xcode.
Posted
by p0deje.
Last updated
.
Post not yet marked as solved
0 Replies
734 Views
I have the following piece of code that is used to trigger pasting of what is currently in the pasteboard: let vCode = UInt16(kVK_ANSI_V) let source = CGEventSource(stateID: .combinedSessionState) source?.setLocalEventsFilterDuringSuppressionState([.permitLocalMouseEvents, .permitSystemDefinedEvents], 																									 state: .eventSuppressionStateSuppressionInterval) let keyVDown = CGEvent(keyboardEventSource: source, virtualKey: vCode, keyDown: true) let keyVUp = CGEvent(keyboardEventSource: source, virtualKey: vCode, keyDown: false) keyVDown?.flags = .maskCommand keyVUp?.flags = .maskCommand keyVDown?.post(tap: .cgAnnotatedSessionEventTap) keyVUp?.post(tap: .cgAnnotatedSessionEventTap) The code worked fine and reliably until I enabled App Sandbox. Now, the code still works in Catalina and Mojave, but silently fails in High Sierra. The application has full accessibility permissions. This code is used in my open source clipboard manager - Maccy. You can see full code in https://github.com/p0deje/Maccy/blob/16ded91a2779b67ebafec92188a61d0b7e713680/Maccy/Clipboard.swift#L87-L100.
Posted
by p0deje.
Last updated
.