Construct and manage a graphical, event-driven user interface for your macOS app using AppKit.

AppKit Documentation

Posts under AppKit subtopic

Post

Replies

Boosts

Views

Activity

NSColorSampler can leave ColorSampler.xpc capturing all mouse clicks after the host app quits
I encountered a severe NSColorSampler failure on macOS 27.0 (26A5425a). After invoking: NSColorSampler().show { selectedColor in // Handle selected colour } the system colour sampler became stuck. The pointer disappeared and all mouse clicks were captured across macOS. Pressing Escape did not recover it. Quitting the host application also did not restore clicking. The Apple-owned process remained active after the application exited: /System/Library/Frameworks/AppKit.framework/Versions/C/XPCServices/ColorSampler.xpc/Contents/MacOS/ColorSampler Sending SIGTERM to that process had no effect. Force-terminating it with SIGKILL immediately restored mouse clicking. Environment: macOS 27.0, build 26A5425a MacBook Pro Mac16,8 Apple M4 Pro SwiftUI content hosted inside a borderless AppKit window Expected behaviour: selecting a colour, pressing Escape, or terminating the host application should cancel sampling and release all captured input. Actual behaviour: ColorSampler.xpc survives the host application and continues preventing all mouse clicks system-wide. Feedback Assistant report: FB24722293 Has anyone else reproduced this with NSColorSampler, particularly from a borderless AppKit window?
1
0
346
12h
Warning Every time NSPopover closes on Golden Gate "Invalid attempt to open a new transaction during CA commit. This is likely to break AppKit transactional behavior. Break on NSCGSTransactionCreatedDuringCommitError to debug."
This warning logs out every time an NSPopover animates closed on macOS Golden Gate: Warning: Invalid attempt to open a new transaction during CA commit. This is likely to break AppKit transactional behavior. Break on NSCGSTransactionCreatedDuringCommitError to debug. I set the breakpoint but am unable to see anything useful. I hit _NSReturnCarbonMenu () just about every second with that breakpoint enabled and a bunch of lldb_unnamed_symbols. Anyone else seeing this? Doesn't seem to be causing any issues but logs so often it is impossible to completely ignore.
1
0
342
1d
NSTextView.shouldDrawInsertionPoint doesn't work with TextKit 2
The following code only ever causes shouldDrawInsertionPoint to be printed (no drawInsertionPoint), but even if that method returns false, the blinking insertion point is still drawn. On the other hand, with TextKit 1 it works as expected. Is there a way to hide the default insertion point in TextKit 2? My app draws its own. I've filed FB13684251. class TextView: NSTextView { override var shouldDrawInsertionPoint: Bool { print("shouldDrawInsertionPoint") return false } override func drawInsertionPoint(in rect: NSRect, color: NSColor, turnedOn flag: Bool) { print("drawInsertionPoint", flag) } } ``
Topic: UI Frameworks SubTopic: AppKit Tags:
12
0
1.1k
2d
NSTrackingSeparatorToolbarItem causes white bar over top of content in macOS 27 developer beta 5
macOS 27 developer beta 5 introduces a bug where an NSTrackingSeparatorToolbarItem in a toolbar causes a bar to appear under the toolbar, overlaying the content. I have a blog post about this at: https://www.virtualsanity.com/202608/nstrackingseparatortoolbaritem-causes-white-bar-over-top-of-content-in-macos-27-developer-beta-5/ I reported this as FB24266969. A sample project and a screenshot are included in both the blog post and the feedback report.
Topic: UI Frameworks SubTopic: AppKit Tags:
7
1
612
3d
Bug or Feature: Changes to Window Reopen Behavior in macOS 26
Since macOS 26 Beta 1, I notice that the window reopening behavior had changed. Say there are two desktops (spaces), one might: open an app window in desktop 1 close that window switch to desktop 2 reopen the app window (by click on dock tile, spotlight search...) Prior to macOS 26, that window will always reopen in current desktop. This is IMO the right behavior because these windows are most likely transient (message app, chat app, utilities app or note app). In macOS 26, however, will switch to desktop 1 (where the window is closed) and reopen the window in desktop 1. This is weird to me because: Window is "closed", hence it should not be attached to desktop 1 anymore, unlike minimize. Switching desktop interrupts user's current workflow. It's annoying to switch back specially when there're many desktops. This behavior is inconsistent. Some reopen in current desktop, some reopen in previous desktop. Apps like Music, Notes and Calendar reopened in previous desktop, while Mail, Messages, and Freeform reopened in current desktop. I did a little bit of experiment, and find out that apps that reopened in current desktop are most likely because they take an extra step to release the window when it's closed. I believe this is a bug, so I fire a feedback (FB18016497) back in beta 1. But I did not get any response or similar report from others, to a point that I kinda wonder if this is intended. I can easily force my app to reopen in current desktop by nullifying my window controller in windowWillClose, but this behavior essentially change how one can use the Spaces feature that I think I should bring this up to the community and see what other developers or engineers thinks about it.
Topic: UI Frameworks SubTopic: AppKit Tags:
5
1
589
4d
Spotlight Shows "Helper Apps" That Are Inside Main App Bundle That Are Not Intended to Be Launched By The User
I have Mac apps that embed “Helper Apps” inside their main bundle. The helper apps do work on behalf of the main application. The helper app doesn’t show a dock icon, it does show minimal UI like an open panel in certain situations (part of NSService implementation). And it does make use of the NSApplication lifecycle and auto quits after it completes all work. Currently the helper app is inside the main app bundle at: /Contents/Applications/HelperApp.app Prior to Tahoe these were never displayed to user in LaunchPad but now the Spotlight based AppLauncher displays them. What’s the recommended way to get these out of the Spotlight App list on macOS Tahoe? Thanks in advance.
8
0
794
5d
Title bar double-click / Fill on macOS 27
I’m seeing a reproducible title-bar interaction issue on macOS 27 RC (26A428). This issue has been present since at least macOS 27 build 26A5416b (Developer Beta 6 / Public Beta 4) and is still reproducible on the Release Candidate, build 26A428. My System Settings → Desktop & Dock → Window title bar double-click action is configured to Fill. In several system apps with sidebars, including: Finder System Settings Reminders Feedback Assistant the right side of the title bar shows a visible rectangular region when the pointer hovers over it. The more important problem is that the middle portion of this region appears to intercept the title-bar double-click. Double-clicking there does nothing, while double-clicking very close to the top or bottom edge of the same region correctly triggers Fill. This makes the normal title-bar gesture surprisingly difficult to use because the center of the title bar is naturally where I would double-click. Interestingly, the sidebar area does not have this problem: double-clicking the top, middle, or bottom portions of the sidebar title-bar area all works normally. Feedback Assistant makes the behavior particularly easy to see because its left sidebar and rightmost pane behave normally, while the title-bar region above the middle pane exhibits the problem. Steps to reproduce: Set “Double-click a window’s title bar” to Fill in Desktop & Dock settings. Open Finder, System Settings, Reminders, or Feedback Assistant. Move the pointer over the right/content portion of the title bar until the rectangular hover region appears. Double-click around the center of that region. The Fill action does not occur. Double-click very close to the upper or lower edge of the same region. Fill works normally. I have reproduced this on macOS 27 RC build 26A428, including: a newly created macOS user account Safe Mode so it does not appear to be caused by migrated preferences, caches, login items, or third-party software. A screen recording demonstrating the exact hit-testing behavior was submitted through Feedback Assistant. Feedback: FB24462749 Is anyone else able to reproduce this? It looks as though some view or overlay in the new title-bar/toolbar area may be intercepting mouse events.
1
0
202
1w
crash when trying to show NSAlert with Mac 27 beta with European and russian languages
Feedback Assistant Submission ID Reference : FB24634485 Attached is a sample code where after setting setlocale() to any of European languages or Russian language results in crash when calling NSAlert. Here is code snippet and crash log for reference. #import <Cocoa/Cocoa.h> int main(int argc, const char * argv[]) { @autoreleasepool { NSString* locale = @“fr_FR.UTF8"; setlocale(LC_ALL, locale.UTF8String); return NSApplicationMain(argc, argv); } } (IBAction)showAlertButtonTapped:(id)sender { NSAlert *alert = [[NSAlert alloc] init]; alert.messageText = NSLocalizedString(@"alert_title", nil); alert.informativeText = NSLocalizedString(@"alert_message", nil); alert.alertStyle = NSAlertStyleInformational; [alert addButtonWithTitle:NSLocalizedString(@"alert_ok_button", nil)]; [alert runModal]; } Crashlog
0
0
121
1w
Empty small white window appears
I recently ported my app from the Sequoia SDK to the Tahoe SDK. The app is written in Objective C and does not use ARC. Everything works well after the major cleanup, except .... A times I see a small empty window pop up. Clicking out of the application usually gets rid of it. I can make it happen fairly regularly on an displayed sheet which presents two NSImageView objects. The user clicks on a button which displays a popup menu; modifies an image then applies the results to one or both of the image views. Having spent two days on this it seems as if the actual setImage on the image view is causing the popup. If I cut out the setImage, it never happens ... even with all other steps in place. I've disabled all animations and tried dozens of things all to no avail. It is not consistent but I can make it happen on two Macs (both running Tahoe). It never happens on Sequoia or earlier when running the build produced with the Tahoe SDK. Any suggestions would be appreciated.
Topic: UI Frameworks SubTopic: AppKit
1
0
593
4w
How to force the temporary fullscreen sidebar as overlay?
My app uses an NSSplitViewController with three vertical split-view items: A sidebar created using +[NSSplitViewItem sidebarWithViewController:] The main content An inspector-like pane Through macOS Sequoia, it always had the following fullscreen sidebar behavior: (The sidebar was collapsed.) Moving the pointer to the left edge of the screen temporarily revealed it. The sidebar appeared as an overlay. The main content and inspector retained their existing frames. After building with the Golden Gate SDK, the temporarily revealed sidebar no longer behaves as an overlay. Depending on minimumThickness and maximumThickness of the items, this either resizes the main content or shifts the complete remaining layout to the side. The resulting animation also stutters because the content is laid out for every intermediate width. Explicitly toggling the sidebar using -[NSSplitViewController toggleSidebar:] is a different case and works correctly in my app. The problem specifically concerns only the automatic, temporary fullscreen reveal initiated by moving the pointer to the screen edge. I want that to remain as an overlay. I have experimented with the split-view items’ holdingPriority, minimumThickness, maximumThickness, minimumThicknessForInlineSidebars and collapseBehavior, but have not found a way to restore the previous overlay behavior. Any ideas how to do that? Thanks a lot!
Topic: UI Frameworks SubTopic: AppKit
2
0
133
Aug ’26
NSTextView Weird Selection Behavior with NSTextAttachmentCells
I have an NSTextView that displays several NSTextAttachmentCells. I notice this weird behavior. Sometimes if I just click in an empty area of the text view the entire text content selects. So I implemented the delegate method to catch it: - (NSRange)textView:(NSTextView *)textView willChangeSelectionFromCharacterRange:(NSRange)oldSelectedCharRange toCharacterRange:(NSRange)newSelectedCharRange { if (newSelectedCharRange.length > 1 && newSelectedCharRange.length > oldSelectedCharRange.length) { NSEvent *currentEvent = NSApp.currentEvent; NSLog(@"Selection expanded from %@ to %@. Event type: %ld, click count: %ld, modifier flags: %lu, current selected ranges: %@", NSStringFromRange(oldSelectedCharRange), NSStringFromRange(newSelectedCharRange), (long)currentEvent.type, (long)currentEvent.clickCount, (unsigned long)currentEvent.modifierFlags, self.selectedRanges); // put a break point here. } return newSelectedCharRange; } And I reproduced the issue and this logs out: Selection expanded from {0, 0} to {0, 6}. Event type: 2, click count: 1, modifier flags: 0, current selected ranges: ( "NSRange: {0, 6} Click count is only 1 so I didn't accidentally triple click. I know on Golden Gate use of NSEvent.currentEvent isn't the way (but I'm not there yet). A simple workaround would be to block the selection right here in the delegate method when clickCount != 3 (but again I know NSEvent.currentEvent in Golden Gate won't be reliable). Anyone run into this and have any ideas? It seems to happen after I did a triple click in the text view at some point previously (but not this click). So I got the feeling that maybe the text view isn't resetting some private properties and is treating this single click as a triple click. But I really don't know. Edit: Hmm maybe it has nothing to do with a previous triple click. May have to do with text selection not accounting for the geometry of the NSTextAttachmentCells. Not sure. But I still have to figure out a way to workaround this because a random select all is really annoying! Call stack looks like: ** -[MyTextView textView:willChangeSelectionFromCharacterRange:toCharacterRange:] at MyTextView.m -[NSTextView(NSSharing) setSelectedRanges:affinity:stillSelecting:] () -[MyTextView setSelectedRanges:affinity:stillSelecting:] MyTextView.m +[NSInputAnalytics(TrackedActionsManager) allowActionTrackingAnalyticsWithName:forAction:] () n -[NSTextView mouseDown:] () -[MyTextView mouseDown:] ** If you're wondering what my -mouseDown: override does it just calls super. I realize this is not a whole lot to go on but any help would be appreciated.
5
0
602
Aug ’26
WKWebView+Purch+StoreKit=Deadend
Does anyone have any advice on working a way around this, or through this? My app is wrapped and WKWebView displays HTML/CSS/JAVA and StoreKit is iOS framework. I used choicely up wrap it because i don't own a mac. The only part i can't control is this. I'll likely have to wrap it myself, rent a cloud Mac and submit directly to ensure everything is attached to the binary. I can't control that from choicely. any other ideas!? I’ve been over a month trying to get this going. It’s live but with no way to transact the subscribers I’m already getting. HELP PLEASE!
0
0
321
Aug ’26
NSToolbarItemViewer no longer resolves hit-testing to a view-based NSToolbarItem's subviews — interactive controls in custom toolbar item views receive no mouse events (regression in macOS 27 beta)
Area: AppKit / NSToolbar Type: Incorrect/Unexpected Behavior (Regression) Summary On macOS 27 beta, when an NSToolbarItem uses a custom view (NSToolbarItem.view) containing interactive controls (e.g. NSButton), clicks on those controls are silently swallowed. Window-level hit-testing stops at the private NSToolbarItemViewer instead of descending into the item's view hierarchy, so the controls never receive mouseDown and their target/action never fires. The same code works correctly on macOS 26 and earlier. This breaks the long-standing, documented view-based toolbar item pattern. Any app that places custom interactive controls inside toolbar items is affected. Steps to Reproduce Create a window with an NSToolbar. In toolbar(_:itemForItemIdentifier:willBeInsertedIntoToolbar:), return an NSToolbarItem whose view is a container NSView holding an NSButton with a target/action. Run on macOS 27 beta and click the button. Minimal repro (complete AppDelegate): import Cocoa @main class AppDelegate: NSObject, NSApplicationDelegate, NSToolbarDelegate { var window: NSWindow! func applicationDidFinishLaunching(_ notification: Notification) { window = NSWindow(contentRect: NSRect(x: 200, y: 200, width: 600, height: 400), styleMask: [.titled, .closable, .resizable], backing: .buffered, defer: false) let toolbar = NSToolbar(identifier: "Main") toolbar.delegate = self window.toolbar = toolbar window.makeKeyAndOrderFront(nil) } func toolbar(_ toolbar: NSToolbar, itemForItemIdentifier id: NSToolbarItem.Identifier, willBeInsertedIntoToolbar flag: Bool) -> NSToolbarItem? { let item = NSToolbarItem(itemIdentifier: id) let container = NSView(frame: NSRect(x: 0, y: 0, width: 120, height: 28)) let button = NSButton(title: "Click Me", target: self, action: #selector(clicked)) button.frame = container.bounds container.addSubview(button) item.view = container return item } @objc func clicked() { NSLog("BUTTON CLICKED") } // never logged on macOS 27 beta func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] { [NSToolbarItem.Identifier("CustomItem")] } func toolbarAllowedItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] { toolbarDefaultItemIdentifiers(toolbar) } } Expected Results: Clicking the button highlights it and fires its action, as on macOS 26 and every earlier release: window hit-testing resolves to the NSButton inside the toolbar item's custom view. Actual Results The click is silently consumed. The button never receives mouseDown, its action never fires, and no toolbar item action is sent either (the item is view-based and has no target/action of its own). Diagnostic Evidence We instrumented hitTest(_:) throughout the hierarchy in our production app and observed, for a single leftMouseDown over the button: The custom subview's own hitTest is invoked during the traversal and correctly returns the NSButton. However, hit-testing initiated from the window's frame view (NSThemeFrame) resolves to NSToolbarItemViewer itself — the subview's result is discarded on the way up. Observed hit path: NSToolbarItemViewer <- NSToolbarView <- NSTitlebarView <- NSTitlebarContainerView <- NSThemeFrame Consequently AppKit dispatches mouseDown to NSToolbarItemViewer, which does nothing for a view-based item, and the event is dropped. This looks like an extension of the macOS 26 beta issue where NSGlassContainerView inside NSToolbarView intercepted hit-testing over the title bar (FB18201935, developer forums thread 788928). On macOS 27 the interception now also applies inside NSToolbarItemViewer for view-based items. Impact All interactive controls hosted in view-based toolbar items are unusable: buttons, search fields, segmented controls, etc. In our production app (RingCentral Video, a video-conferencing client), every in-meeting title-bar control (meeting info, network quality, view switcher, report) stopped responding on macOS 27 beta. We have shipped an application-level workaround that re-dispatches the event to the control when window hit-testing terminates at an ancestor of it, but this requires every affected app to implement custom event routing around a private view's behavior. FB24375035
Topic: UI Frameworks SubTopic: AppKit
1
0
132
Aug ’26
Custom pointer color makes -[NSCursor set] re-render from PDF on every call, pinning a CPU core across unrelated apps (macOS 27.0)
Filed as FB24344519. Posting here too because the scope is wider than any single app, and other developers may be getting "your app uses too much CPU" reports that are not actually their bug. Environment: macOS 27.0 (26A5406e), Apple Silicon (M5 Max). SUMMARY When a custom pointer color is set, every -[NSCursor set] call re-renders the pointer artwork from a PDF, with no caching. Any app whose UI frequently invalidates AppKit tracking areas then burns most of a CPU core continuously, with the mouse completely stationary. Trigger: defaults read com.apple.universalaccess cursorIsCustomized 1 That is System Settings > Accessibility > Display > Pointer, with a custom fill and outline color set. With default pointer colors, -[NSCursor set] is nearly free. CALL PATH (sampled with the mouse untouched) CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK -[_NSTrackingAreaAKManager _activeTrackingAreasNeedUpdate]_block_invoke -[_NSTrackingAreaAKManager _updateActiveTrackingAreasForWindowLocation:modifierFlags:] -[NSCursor set] -[NSCursor _reallySet] _AXFCursorSetAndReturnSeed (AccessibilityFoundation) -[_AXFMouseCursorGenerator createImageForScale:] -[_AXFMouseCursorGeneratorLayer _createImageForScale:color:] -[_AXFMouseCursorGeneratorLayer _pdfPage] / _pdf CGPDFScannerScan -> CGPDFDrawingContextDrawPath createImageWithSizeRenderInstructions __createImageWithMaskedColor_block_invoke CGContextClipToMask -> CGContextDrawImage -> A8_image_mark_rgb32 The pointer artwork is re-parsed from PDF and re-composited on every tracking-area update. SCOPE Main-thread samples in that path, mouse stationary: com.apple.weather.menu (Catalyst/UIKit): 1170 / 1327 = 88% Cloudflare WARP (Flutter): 1095 / 1154 = 95% Dayflow (SwiftUI/AppKit): 273 / 431 = 63% (bursts) Three unrelated UI toolkits, identical stack, including one of Apple's own menu bar apps. Apps with a mostly static UI are unaffected on the same machine with the same setting enabled, so the amplifier appears to be tracking-area invalidation frequency rather than the toolkit. Direct measurement of WeatherMenu with the trackpad untouched: 21.8 seconds of CPU in a 30 second window (73% of one core), sustained indefinitely, and 491 minutes of CPU time over 3 days of uptime. STEPS TO REPRODUCE System Settings > Accessibility > Display > Pointer. Set a custom pointer fill and outline color. Enable the Weather menu bar item (Control Center > Weather). Leave the machine idle. Do not touch the trackpad or mouse. Watch com.apple.weather.menu in Activity Monitor. Expected: near 0% CPU while idle. -[NSCursor set] with an unchanged cursor should be a cheap no-op. Actual: 65-75% of a core held indefinitely with no user input. CAVEAT I have not toggled cursorIsCustomized back off to confirm the CPU drops, so the dependency is inferred from the stack reaching the custom-color renderer (_createImageForScale:color:, createImageWithMaskedColor), which is only used when a custom pointer color is set. About a minute for anyone to verify. NOTES FOR OTHER DEVELOPERS Two things that cost me time: ps %CPU on macOS is a short decaying average, not steady state. It made an app look like it sat at 80% when its actual idle draw was under 4%. Compare cumulative CPU time deltas instead. sample counts blocked threads too, so "N% of main-thread samples" is not the same as N% CPU. Check whether the leaf frames are actually running code first. If your users report high CPU you cannot reproduce, it may be worth asking whether they have a custom pointer color set. SUGGESTED FIX Cache the generated cursor image in _AXFMouseCursorGenerator, and make -[NSCursor set] a no-op when the cursor and scale are unchanged, rather than re-parsing and re-rendering the PDF on every call. Happy to provide full samples or a sysdiagnose.
Topic: UI Frameworks SubTopic: AppKit
0
0
162
Aug ’26
NSInternalInconsistencyException assertion from [NSRemoteView containingWindowWillOrderOnScreen:] on macOS 27 (26A5378j)
Is anyone else getting these assertion crashes on developer beta 3 of Golden Gate? I've gotten more than a dozen crash logs from users running macOS 27 (26A5378j) that all look like this: assertion failed: '<NSRemoteView: 0x79cb366700 com.apple.SafariPlatformSupport.Helper SPCompletionListServiceViewController> notified of <NSStatusBarWindow: 0x79cbef7480> but expected (null)' in -[NSRemoteView containingWindowWillOrderOnScreen:] on line 4221 of file /AppleInternal/Library/BuildRoots/4~CSuOugB1YCxzYMPRWEumvvfCTNtf98eItTmsbJU/Library/Caches/com.apple.xbs/TemporaryDirectory.N8fh9t/Sources/ViewBridge/NSRemoteView.m but with various windows from my app after "notified of". They're getting thrown when one of my windows is made frontmost, either using NSWindow.orderFrontRegardless or NSWindow.makeKeyAndOrderFront, or (in the case above) when my status item is shown. It's intermittent - I've been unable to reproduce it so far - but definitely happening repeatedly based on my Sentry crash logging. Is this a bug in Golden Gate b3, or am I doing something to provoke this? I've submitted it via Feedback Assistant (FB23642313). Thanks Jon P.S. Full stack trace attached for the exception thrown when the assertion fails for NSStatusBarWindow NSInternalInconsistencyException stack trace.txt
Topic: UI Frameworks SubTopic: AppKit
10
4
1.6k
Aug ’26
Vertically Off-Center Components in NSSearchToolbarItem in macOS 27 Developer Beta 5
In macOS 27 developer beta 5, search fields in toolbars (NSSearchToolbarItem instances) have their placeholder text, search strings, and magnifying glass icons vertically off-center. I reported this as FB24286690. You can see this in the Feedback Assistant app. The “Search” placeholder text, the magnifying glass, and the search string are all closer to the top of the toolbar item than the bottom. My feedback has a sample project demonstrating this, along with screenshots. I have a more detailed writeup at: https://www.virtualsanity.com/202608/vertically-off-center-components-in-nssearchtoolbaritem-in-macos-27-developer-beta-5/
Topic: UI Frameworks SubTopic: AppKit Tags:
0
0
225
Aug ’26
Various menu bar NSStatusItem issues with macOS 27
It seems like macOS 27 beta 2 has some issues with NSStatusItem buttons added to the menu bar - this creates difficulties for some menu bar extra apps. NSStatusItem buttons does not receive mouse hover/movement events - FB23329983 On macOS 27, views inside an NSStatusItem button no longer receive hover or mouse-movement events. The same code works correctly on macOS 26. What I tried: An NSTrackingArea attached to a subview of NSStatusBarButton An NSTrackingArea attached directly to the status-bar button Replacing NSStatusItem.view with a custom view Embedding an NSHostingView and using SwiftUI onHover/onContinuousHover NSStatusItem button highlight cannot be set programmatically. - FB23330269 The following code no longer has any effect (does not provide the highlight capsule): NSStatusItem.button?.highlight(true) NSStatusItem window occlusionState no longer reflects hidden menu bar visibility - FB23349447 The following no longer works: statusItem.button?.window?.occlusionState.contains(.visible) These changes may be related to some of the touch related changes or maybe it's about how menu items are now seemingly more "managed" in a way that their position, visibility may change in a way that is transparent/undetectable to the app.
6
2
1k
Aug ’26
NSSearchToolbarItem cancel button triggers action before clearing text and before the ending search notification
I am trying to use an NSSearchToolbarItem using AppKit directly in Objective-C. If I perform a search and then click the cancel icon, my target/action is called while the NSSearchField still contains the search text (not yet cleared) and the delegate has not yet received the ending search invocation. In other words, it looks exactly the same as if the user had submitted the same search twice. Google's AI suggested using the controlTextDidChange method, but that was deprecated long ago. My current solution is to ignore searches that appear redundant (although they may not be, if the data being searched changes). This is on macOS 26.6.
Topic: UI Frameworks SubTopic: AppKit Tags:
0
0
450
Aug ’26
Finder Sync: Opening a floating NSPanel from a Finder context menu
Hi! I'm experimenting with a macOS app using Finder Sync, and I'd like to make sure I'm heading in the right direction before I build too much. The workflow I'm aiming for is: • Right-click a folder in Finder • Choose "Create Sticky Note" • Get the selected folder URL • Launch (or activate) the main app • Open a small floating NSPanel that's associated with that folder The panel itself would live in the main app, not inside the Finder extension. The goal is simply to store notes associated with a specific folder. A few questions: Is Finder Sync the right technology for this kind of workflow, or is there a better API I should be looking at? Is opening a floating NSPanel from a Finder context menu (via the main app) a reasonable architecture on current versions of macOS? What's the preferred way for a Finder Sync extension to communicate with the main app these days? XPC? App Groups? Distributed Notifications? Something else? Are there any sandbox or App Store review limitations I should be aware of with this approach? I'd really appreciate any advice or examples from anyone who's built something similar. Thanks! P.S. English isn't my first language, so AI helped me with the writing—but the questions are mine. 😄
Topic: UI Frameworks SubTopic: AppKit
0
0
397
Aug ’26
window:willUseFullScreenPresentationOptions: with NSApplicationPresentationHideDock causes other windows to be unminimizable
In the below code, I create two windows, and use a window delegate to make sure that whenever the first is fullscreened, its menubar and dock are hidden properly. However, when I fullscreen the first window and go back to the desktop to see my second window, the second window's minimize button is grayed out and using miniaturize on it will not work either. I've tried various things; it seems like if I fullscreen the second window and the unfullscreen it, it then becomes minimizable without additional side effects. Is there any reason why this is happening? This seems like a bug in AppKit... so how do I work around it programmatically? #import <Cocoa/Cocoa.h> @interface AppDelegate : NSObject <NSApplicationDelegate, NSWindowDelegate> @property (strong) NSWindow *mainWindow; @property (strong) NSWindow *secondaryWindow; @end @implementation AppDelegate - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { NSRect mainRect = NSMakeRect(100, 300, 400, 300); self.mainWindow = [[NSWindow alloc] initWithContentRect:mainRect styleMask:(NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskResizable) backing:NSBackingStoreBuffered defer:NO]; [self.mainWindow setTitle:@"Main Window (Go Fullscreen Here)"]; [self.mainWindow setDelegate:self]; NSTextField *mainLabel = [NSTextField labelWithString:@"1. Click the green zoom/fullscreen button on THIS window.\n\n2. Look at the other window's yellow minimize button."]; [mainLabel setFrame:NSMakeRect(20, 100, 360, 100)]; [[self.mainWindow contentView] addSubview:mainLabel]; [self.mainWindow makeKeyAndOrderFront:nil]; NSRect secondaryRect = NSMakeRect(550, 300, 400, 300); self.secondaryWindow = [[NSWindow alloc] initWithContentRect:secondaryRect styleMask:(NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskResizable) backing:NSBackingStoreBuffered defer:NO]; [self.secondaryWindow setTitle:@"Secondary Window (The Victim)"]; NSButton *testButton = [NSButton buttonWithTitle:@"Try code [window miniaturize:]" target:self action:@selector(attemptProgrammaticMinimize:)]; [testButton setFrame:NSMakeRect(80, 130, 240, 40)]; [[self.secondaryWindow contentView] addSubview:testButton]; [self.secondaryWindow makeKeyAndOrderFront:nil]; } - (NSApplicationPresentationOptions)window:(NSWindow *)window willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions { return NSApplicationPresentationFullScreen | NSApplicationPresentationHideMenuBar | NSApplicationPresentationHideDock; } - (void)attemptProgrammaticMinimize:(id)sender { [self.secondaryWindow miniaturize:nil]; NSLog(@"[Repro] Minimize attempted"); } - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender { return YES; } @end int main(int argc, const char * argv[]) { @autoreleasepool { NSApplication *app = [NSApplication sharedApplication]; [app setActivationPolicy:NSApplicationActivationPolicyRegular]; AppDelegate *delegate = [[AppDelegate alloc] init]; [app setDelegate:delegate]; [app activateIgnoringOtherApps:YES]; [app run]; } return 0; }
3
0
861
Aug ’26
NSColorSampler can leave ColorSampler.xpc capturing all mouse clicks after the host app quits
I encountered a severe NSColorSampler failure on macOS 27.0 (26A5425a). After invoking: NSColorSampler().show { selectedColor in // Handle selected colour } the system colour sampler became stuck. The pointer disappeared and all mouse clicks were captured across macOS. Pressing Escape did not recover it. Quitting the host application also did not restore clicking. The Apple-owned process remained active after the application exited: /System/Library/Frameworks/AppKit.framework/Versions/C/XPCServices/ColorSampler.xpc/Contents/MacOS/ColorSampler Sending SIGTERM to that process had no effect. Force-terminating it with SIGKILL immediately restored mouse clicking. Environment: macOS 27.0, build 26A5425a MacBook Pro Mac16,8 Apple M4 Pro SwiftUI content hosted inside a borderless AppKit window Expected behaviour: selecting a colour, pressing Escape, or terminating the host application should cancel sampling and release all captured input. Actual behaviour: ColorSampler.xpc survives the host application and continues preventing all mouse clicks system-wide. Feedback Assistant report: FB24722293 Has anyone else reproduced this with NSColorSampler, particularly from a borderless AppKit window?
Replies
1
Boosts
0
Views
346
Activity
12h
Warning Every time NSPopover closes on Golden Gate "Invalid attempt to open a new transaction during CA commit. This is likely to break AppKit transactional behavior. Break on NSCGSTransactionCreatedDuringCommitError to debug."
This warning logs out every time an NSPopover animates closed on macOS Golden Gate: Warning: Invalid attempt to open a new transaction during CA commit. This is likely to break AppKit transactional behavior. Break on NSCGSTransactionCreatedDuringCommitError to debug. I set the breakpoint but am unable to see anything useful. I hit _NSReturnCarbonMenu () just about every second with that breakpoint enabled and a bunch of lldb_unnamed_symbols. Anyone else seeing this? Doesn't seem to be causing any issues but logs so often it is impossible to completely ignore.
Replies
1
Boosts
0
Views
342
Activity
1d
NSTextView.shouldDrawInsertionPoint doesn't work with TextKit 2
The following code only ever causes shouldDrawInsertionPoint to be printed (no drawInsertionPoint), but even if that method returns false, the blinking insertion point is still drawn. On the other hand, with TextKit 1 it works as expected. Is there a way to hide the default insertion point in TextKit 2? My app draws its own. I've filed FB13684251. class TextView: NSTextView { override var shouldDrawInsertionPoint: Bool { print("shouldDrawInsertionPoint") return false } override func drawInsertionPoint(in rect: NSRect, color: NSColor, turnedOn flag: Bool) { print("drawInsertionPoint", flag) } } ``
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
12
Boosts
0
Views
1.1k
Activity
2d
NSTrackingSeparatorToolbarItem causes white bar over top of content in macOS 27 developer beta 5
macOS 27 developer beta 5 introduces a bug where an NSTrackingSeparatorToolbarItem in a toolbar causes a bar to appear under the toolbar, overlaying the content. I have a blog post about this at: https://www.virtualsanity.com/202608/nstrackingseparatortoolbaritem-causes-white-bar-over-top-of-content-in-macos-27-developer-beta-5/ I reported this as FB24266969. A sample project and a screenshot are included in both the blog post and the feedback report.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
7
Boosts
1
Views
612
Activity
3d
Bug or Feature: Changes to Window Reopen Behavior in macOS 26
Since macOS 26 Beta 1, I notice that the window reopening behavior had changed. Say there are two desktops (spaces), one might: open an app window in desktop 1 close that window switch to desktop 2 reopen the app window (by click on dock tile, spotlight search...) Prior to macOS 26, that window will always reopen in current desktop. This is IMO the right behavior because these windows are most likely transient (message app, chat app, utilities app or note app). In macOS 26, however, will switch to desktop 1 (where the window is closed) and reopen the window in desktop 1. This is weird to me because: Window is "closed", hence it should not be attached to desktop 1 anymore, unlike minimize. Switching desktop interrupts user's current workflow. It's annoying to switch back specially when there're many desktops. This behavior is inconsistent. Some reopen in current desktop, some reopen in previous desktop. Apps like Music, Notes and Calendar reopened in previous desktop, while Mail, Messages, and Freeform reopened in current desktop. I did a little bit of experiment, and find out that apps that reopened in current desktop are most likely because they take an extra step to release the window when it's closed. I believe this is a bug, so I fire a feedback (FB18016497) back in beta 1. But I did not get any response or similar report from others, to a point that I kinda wonder if this is intended. I can easily force my app to reopen in current desktop by nullifying my window controller in windowWillClose, but this behavior essentially change how one can use the Spaces feature that I think I should bring this up to the community and see what other developers or engineers thinks about it.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
5
Boosts
1
Views
589
Activity
4d
Spotlight Shows "Helper Apps" That Are Inside Main App Bundle That Are Not Intended to Be Launched By The User
I have Mac apps that embed “Helper Apps” inside their main bundle. The helper apps do work on behalf of the main application. The helper app doesn’t show a dock icon, it does show minimal UI like an open panel in certain situations (part of NSService implementation). And it does make use of the NSApplication lifecycle and auto quits after it completes all work. Currently the helper app is inside the main app bundle at: /Contents/Applications/HelperApp.app Prior to Tahoe these were never displayed to user in LaunchPad but now the Spotlight based AppLauncher displays them. What’s the recommended way to get these out of the Spotlight App list on macOS Tahoe? Thanks in advance.
Replies
8
Boosts
0
Views
794
Activity
5d
Title bar double-click / Fill on macOS 27
I’m seeing a reproducible title-bar interaction issue on macOS 27 RC (26A428). This issue has been present since at least macOS 27 build 26A5416b (Developer Beta 6 / Public Beta 4) and is still reproducible on the Release Candidate, build 26A428. My System Settings → Desktop & Dock → Window title bar double-click action is configured to Fill. In several system apps with sidebars, including: Finder System Settings Reminders Feedback Assistant the right side of the title bar shows a visible rectangular region when the pointer hovers over it. The more important problem is that the middle portion of this region appears to intercept the title-bar double-click. Double-clicking there does nothing, while double-clicking very close to the top or bottom edge of the same region correctly triggers Fill. This makes the normal title-bar gesture surprisingly difficult to use because the center of the title bar is naturally where I would double-click. Interestingly, the sidebar area does not have this problem: double-clicking the top, middle, or bottom portions of the sidebar title-bar area all works normally. Feedback Assistant makes the behavior particularly easy to see because its left sidebar and rightmost pane behave normally, while the title-bar region above the middle pane exhibits the problem. Steps to reproduce: Set “Double-click a window’s title bar” to Fill in Desktop & Dock settings. Open Finder, System Settings, Reminders, or Feedback Assistant. Move the pointer over the right/content portion of the title bar until the rectangular hover region appears. Double-click around the center of that region. The Fill action does not occur. Double-click very close to the upper or lower edge of the same region. Fill works normally. I have reproduced this on macOS 27 RC build 26A428, including: a newly created macOS user account Safe Mode so it does not appear to be caused by migrated preferences, caches, login items, or third-party software. A screen recording demonstrating the exact hit-testing behavior was submitted through Feedback Assistant. Feedback: FB24462749 Is anyone else able to reproduce this? It looks as though some view or overlay in the new title-bar/toolbar area may be intercepting mouse events.
Replies
1
Boosts
0
Views
202
Activity
1w
crash when trying to show NSAlert with Mac 27 beta with European and russian languages
Feedback Assistant Submission ID Reference : FB24634485 Attached is a sample code where after setting setlocale() to any of European languages or Russian language results in crash when calling NSAlert. Here is code snippet and crash log for reference. #import <Cocoa/Cocoa.h> int main(int argc, const char * argv[]) { @autoreleasepool { NSString* locale = @“fr_FR.UTF8"; setlocale(LC_ALL, locale.UTF8String); return NSApplicationMain(argc, argv); } } (IBAction)showAlertButtonTapped:(id)sender { NSAlert *alert = [[NSAlert alloc] init]; alert.messageText = NSLocalizedString(@"alert_title", nil); alert.informativeText = NSLocalizedString(@"alert_message", nil); alert.alertStyle = NSAlertStyleInformational; [alert addButtonWithTitle:NSLocalizedString(@"alert_ok_button", nil)]; [alert runModal]; } Crashlog
Replies
0
Boosts
0
Views
121
Activity
1w
Empty small white window appears
I recently ported my app from the Sequoia SDK to the Tahoe SDK. The app is written in Objective C and does not use ARC. Everything works well after the major cleanup, except .... A times I see a small empty window pop up. Clicking out of the application usually gets rid of it. I can make it happen fairly regularly on an displayed sheet which presents two NSImageView objects. The user clicks on a button which displays a popup menu; modifies an image then applies the results to one or both of the image views. Having spent two days on this it seems as if the actual setImage on the image view is causing the popup. If I cut out the setImage, it never happens ... even with all other steps in place. I've disabled all animations and tried dozens of things all to no avail. It is not consistent but I can make it happen on two Macs (both running Tahoe). It never happens on Sequoia or earlier when running the build produced with the Tahoe SDK. Any suggestions would be appreciated.
Topic: UI Frameworks SubTopic: AppKit
Replies
1
Boosts
0
Views
593
Activity
4w
How to force the temporary fullscreen sidebar as overlay?
My app uses an NSSplitViewController with three vertical split-view items: A sidebar created using +[NSSplitViewItem sidebarWithViewController:] The main content An inspector-like pane Through macOS Sequoia, it always had the following fullscreen sidebar behavior: (The sidebar was collapsed.) Moving the pointer to the left edge of the screen temporarily revealed it. The sidebar appeared as an overlay. The main content and inspector retained their existing frames. After building with the Golden Gate SDK, the temporarily revealed sidebar no longer behaves as an overlay. Depending on minimumThickness and maximumThickness of the items, this either resizes the main content or shifts the complete remaining layout to the side. The resulting animation also stutters because the content is laid out for every intermediate width. Explicitly toggling the sidebar using -[NSSplitViewController toggleSidebar:] is a different case and works correctly in my app. The problem specifically concerns only the automatic, temporary fullscreen reveal initiated by moving the pointer to the screen edge. I want that to remain as an overlay. I have experimented with the split-view items’ holdingPriority, minimumThickness, maximumThickness, minimumThicknessForInlineSidebars and collapseBehavior, but have not found a way to restore the previous overlay behavior. Any ideas how to do that? Thanks a lot!
Topic: UI Frameworks SubTopic: AppKit
Replies
2
Boosts
0
Views
133
Activity
Aug ’26
NSTextView Weird Selection Behavior with NSTextAttachmentCells
I have an NSTextView that displays several NSTextAttachmentCells. I notice this weird behavior. Sometimes if I just click in an empty area of the text view the entire text content selects. So I implemented the delegate method to catch it: - (NSRange)textView:(NSTextView *)textView willChangeSelectionFromCharacterRange:(NSRange)oldSelectedCharRange toCharacterRange:(NSRange)newSelectedCharRange { if (newSelectedCharRange.length > 1 && newSelectedCharRange.length > oldSelectedCharRange.length) { NSEvent *currentEvent = NSApp.currentEvent; NSLog(@"Selection expanded from %@ to %@. Event type: %ld, click count: %ld, modifier flags: %lu, current selected ranges: %@", NSStringFromRange(oldSelectedCharRange), NSStringFromRange(newSelectedCharRange), (long)currentEvent.type, (long)currentEvent.clickCount, (unsigned long)currentEvent.modifierFlags, self.selectedRanges); // put a break point here. } return newSelectedCharRange; } And I reproduced the issue and this logs out: Selection expanded from {0, 0} to {0, 6}. Event type: 2, click count: 1, modifier flags: 0, current selected ranges: ( "NSRange: {0, 6} Click count is only 1 so I didn't accidentally triple click. I know on Golden Gate use of NSEvent.currentEvent isn't the way (but I'm not there yet). A simple workaround would be to block the selection right here in the delegate method when clickCount != 3 (but again I know NSEvent.currentEvent in Golden Gate won't be reliable). Anyone run into this and have any ideas? It seems to happen after I did a triple click in the text view at some point previously (but not this click). So I got the feeling that maybe the text view isn't resetting some private properties and is treating this single click as a triple click. But I really don't know. Edit: Hmm maybe it has nothing to do with a previous triple click. May have to do with text selection not accounting for the geometry of the NSTextAttachmentCells. Not sure. But I still have to figure out a way to workaround this because a random select all is really annoying! Call stack looks like: ** -[MyTextView textView:willChangeSelectionFromCharacterRange:toCharacterRange:] at MyTextView.m -[NSTextView(NSSharing) setSelectedRanges:affinity:stillSelecting:] () -[MyTextView setSelectedRanges:affinity:stillSelecting:] MyTextView.m +[NSInputAnalytics(TrackedActionsManager) allowActionTrackingAnalyticsWithName:forAction:] () n -[NSTextView mouseDown:] () -[MyTextView mouseDown:] ** If you're wondering what my -mouseDown: override does it just calls super. I realize this is not a whole lot to go on but any help would be appreciated.
Replies
5
Boosts
0
Views
602
Activity
Aug ’26
WKWebView+Purch+StoreKit=Deadend
Does anyone have any advice on working a way around this, or through this? My app is wrapped and WKWebView displays HTML/CSS/JAVA and StoreKit is iOS framework. I used choicely up wrap it because i don't own a mac. The only part i can't control is this. I'll likely have to wrap it myself, rent a cloud Mac and submit directly to ensure everything is attached to the binary. I can't control that from choicely. any other ideas!? I’ve been over a month trying to get this going. It’s live but with no way to transact the subscribers I’m already getting. HELP PLEASE!
Replies
0
Boosts
0
Views
321
Activity
Aug ’26
NSToolbarItemViewer no longer resolves hit-testing to a view-based NSToolbarItem's subviews — interactive controls in custom toolbar item views receive no mouse events (regression in macOS 27 beta)
Area: AppKit / NSToolbar Type: Incorrect/Unexpected Behavior (Regression) Summary On macOS 27 beta, when an NSToolbarItem uses a custom view (NSToolbarItem.view) containing interactive controls (e.g. NSButton), clicks on those controls are silently swallowed. Window-level hit-testing stops at the private NSToolbarItemViewer instead of descending into the item's view hierarchy, so the controls never receive mouseDown and their target/action never fires. The same code works correctly on macOS 26 and earlier. This breaks the long-standing, documented view-based toolbar item pattern. Any app that places custom interactive controls inside toolbar items is affected. Steps to Reproduce Create a window with an NSToolbar. In toolbar(_:itemForItemIdentifier:willBeInsertedIntoToolbar:), return an NSToolbarItem whose view is a container NSView holding an NSButton with a target/action. Run on macOS 27 beta and click the button. Minimal repro (complete AppDelegate): import Cocoa @main class AppDelegate: NSObject, NSApplicationDelegate, NSToolbarDelegate { var window: NSWindow! func applicationDidFinishLaunching(_ notification: Notification) { window = NSWindow(contentRect: NSRect(x: 200, y: 200, width: 600, height: 400), styleMask: [.titled, .closable, .resizable], backing: .buffered, defer: false) let toolbar = NSToolbar(identifier: "Main") toolbar.delegate = self window.toolbar = toolbar window.makeKeyAndOrderFront(nil) } func toolbar(_ toolbar: NSToolbar, itemForItemIdentifier id: NSToolbarItem.Identifier, willBeInsertedIntoToolbar flag: Bool) -> NSToolbarItem? { let item = NSToolbarItem(itemIdentifier: id) let container = NSView(frame: NSRect(x: 0, y: 0, width: 120, height: 28)) let button = NSButton(title: "Click Me", target: self, action: #selector(clicked)) button.frame = container.bounds container.addSubview(button) item.view = container return item } @objc func clicked() { NSLog("BUTTON CLICKED") } // never logged on macOS 27 beta func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] { [NSToolbarItem.Identifier("CustomItem")] } func toolbarAllowedItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] { toolbarDefaultItemIdentifiers(toolbar) } } Expected Results: Clicking the button highlights it and fires its action, as on macOS 26 and every earlier release: window hit-testing resolves to the NSButton inside the toolbar item's custom view. Actual Results The click is silently consumed. The button never receives mouseDown, its action never fires, and no toolbar item action is sent either (the item is view-based and has no target/action of its own). Diagnostic Evidence We instrumented hitTest(_:) throughout the hierarchy in our production app and observed, for a single leftMouseDown over the button: The custom subview's own hitTest is invoked during the traversal and correctly returns the NSButton. However, hit-testing initiated from the window's frame view (NSThemeFrame) resolves to NSToolbarItemViewer itself — the subview's result is discarded on the way up. Observed hit path: NSToolbarItemViewer <- NSToolbarView <- NSTitlebarView <- NSTitlebarContainerView <- NSThemeFrame Consequently AppKit dispatches mouseDown to NSToolbarItemViewer, which does nothing for a view-based item, and the event is dropped. This looks like an extension of the macOS 26 beta issue where NSGlassContainerView inside NSToolbarView intercepted hit-testing over the title bar (FB18201935, developer forums thread 788928). On macOS 27 the interception now also applies inside NSToolbarItemViewer for view-based items. Impact All interactive controls hosted in view-based toolbar items are unusable: buttons, search fields, segmented controls, etc. In our production app (RingCentral Video, a video-conferencing client), every in-meeting title-bar control (meeting info, network quality, view switcher, report) stopped responding on macOS 27 beta. We have shipped an application-level workaround that re-dispatches the event to the control when window hit-testing terminates at an ancestor of it, but this requires every affected app to implement custom event routing around a private view's behavior. FB24375035
Topic: UI Frameworks SubTopic: AppKit
Replies
1
Boosts
0
Views
132
Activity
Aug ’26
Custom pointer color makes -[NSCursor set] re-render from PDF on every call, pinning a CPU core across unrelated apps (macOS 27.0)
Filed as FB24344519. Posting here too because the scope is wider than any single app, and other developers may be getting "your app uses too much CPU" reports that are not actually their bug. Environment: macOS 27.0 (26A5406e), Apple Silicon (M5 Max). SUMMARY When a custom pointer color is set, every -[NSCursor set] call re-renders the pointer artwork from a PDF, with no caching. Any app whose UI frequently invalidates AppKit tracking areas then burns most of a CPU core continuously, with the mouse completely stationary. Trigger: defaults read com.apple.universalaccess cursorIsCustomized 1 That is System Settings > Accessibility > Display > Pointer, with a custom fill and outline color set. With default pointer colors, -[NSCursor set] is nearly free. CALL PATH (sampled with the mouse untouched) CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK -[_NSTrackingAreaAKManager _activeTrackingAreasNeedUpdate]_block_invoke -[_NSTrackingAreaAKManager _updateActiveTrackingAreasForWindowLocation:modifierFlags:] -[NSCursor set] -[NSCursor _reallySet] _AXFCursorSetAndReturnSeed (AccessibilityFoundation) -[_AXFMouseCursorGenerator createImageForScale:] -[_AXFMouseCursorGeneratorLayer _createImageForScale:color:] -[_AXFMouseCursorGeneratorLayer _pdfPage] / _pdf CGPDFScannerScan -> CGPDFDrawingContextDrawPath createImageWithSizeRenderInstructions __createImageWithMaskedColor_block_invoke CGContextClipToMask -> CGContextDrawImage -> A8_image_mark_rgb32 The pointer artwork is re-parsed from PDF and re-composited on every tracking-area update. SCOPE Main-thread samples in that path, mouse stationary: com.apple.weather.menu (Catalyst/UIKit): 1170 / 1327 = 88% Cloudflare WARP (Flutter): 1095 / 1154 = 95% Dayflow (SwiftUI/AppKit): 273 / 431 = 63% (bursts) Three unrelated UI toolkits, identical stack, including one of Apple's own menu bar apps. Apps with a mostly static UI are unaffected on the same machine with the same setting enabled, so the amplifier appears to be tracking-area invalidation frequency rather than the toolkit. Direct measurement of WeatherMenu with the trackpad untouched: 21.8 seconds of CPU in a 30 second window (73% of one core), sustained indefinitely, and 491 minutes of CPU time over 3 days of uptime. STEPS TO REPRODUCE System Settings > Accessibility > Display > Pointer. Set a custom pointer fill and outline color. Enable the Weather menu bar item (Control Center > Weather). Leave the machine idle. Do not touch the trackpad or mouse. Watch com.apple.weather.menu in Activity Monitor. Expected: near 0% CPU while idle. -[NSCursor set] with an unchanged cursor should be a cheap no-op. Actual: 65-75% of a core held indefinitely with no user input. CAVEAT I have not toggled cursorIsCustomized back off to confirm the CPU drops, so the dependency is inferred from the stack reaching the custom-color renderer (_createImageForScale:color:, createImageWithMaskedColor), which is only used when a custom pointer color is set. About a minute for anyone to verify. NOTES FOR OTHER DEVELOPERS Two things that cost me time: ps %CPU on macOS is a short decaying average, not steady state. It made an app look like it sat at 80% when its actual idle draw was under 4%. Compare cumulative CPU time deltas instead. sample counts blocked threads too, so "N% of main-thread samples" is not the same as N% CPU. Check whether the leaf frames are actually running code first. If your users report high CPU you cannot reproduce, it may be worth asking whether they have a custom pointer color set. SUGGESTED FIX Cache the generated cursor image in _AXFMouseCursorGenerator, and make -[NSCursor set] a no-op when the cursor and scale are unchanged, rather than re-parsing and re-rendering the PDF on every call. Happy to provide full samples or a sysdiagnose.
Topic: UI Frameworks SubTopic: AppKit
Replies
0
Boosts
0
Views
162
Activity
Aug ’26
NSInternalInconsistencyException assertion from [NSRemoteView containingWindowWillOrderOnScreen:] on macOS 27 (26A5378j)
Is anyone else getting these assertion crashes on developer beta 3 of Golden Gate? I've gotten more than a dozen crash logs from users running macOS 27 (26A5378j) that all look like this: assertion failed: '<NSRemoteView: 0x79cb366700 com.apple.SafariPlatformSupport.Helper SPCompletionListServiceViewController> notified of <NSStatusBarWindow: 0x79cbef7480> but expected (null)' in -[NSRemoteView containingWindowWillOrderOnScreen:] on line 4221 of file /AppleInternal/Library/BuildRoots/4~CSuOugB1YCxzYMPRWEumvvfCTNtf98eItTmsbJU/Library/Caches/com.apple.xbs/TemporaryDirectory.N8fh9t/Sources/ViewBridge/NSRemoteView.m but with various windows from my app after "notified of". They're getting thrown when one of my windows is made frontmost, either using NSWindow.orderFrontRegardless or NSWindow.makeKeyAndOrderFront, or (in the case above) when my status item is shown. It's intermittent - I've been unable to reproduce it so far - but definitely happening repeatedly based on my Sentry crash logging. Is this a bug in Golden Gate b3, or am I doing something to provoke this? I've submitted it via Feedback Assistant (FB23642313). Thanks Jon P.S. Full stack trace attached for the exception thrown when the assertion fails for NSStatusBarWindow NSInternalInconsistencyException stack trace.txt
Topic: UI Frameworks SubTopic: AppKit
Replies
10
Boosts
4
Views
1.6k
Activity
Aug ’26
Vertically Off-Center Components in NSSearchToolbarItem in macOS 27 Developer Beta 5
In macOS 27 developer beta 5, search fields in toolbars (NSSearchToolbarItem instances) have their placeholder text, search strings, and magnifying glass icons vertically off-center. I reported this as FB24286690. You can see this in the Feedback Assistant app. The “Search” placeholder text, the magnifying glass, and the search string are all closer to the top of the toolbar item than the bottom. My feedback has a sample project demonstrating this, along with screenshots. I have a more detailed writeup at: https://www.virtualsanity.com/202608/vertically-off-center-components-in-nssearchtoolbaritem-in-macos-27-developer-beta-5/
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
0
Boosts
0
Views
225
Activity
Aug ’26
Various menu bar NSStatusItem issues with macOS 27
It seems like macOS 27 beta 2 has some issues with NSStatusItem buttons added to the menu bar - this creates difficulties for some menu bar extra apps. NSStatusItem buttons does not receive mouse hover/movement events - FB23329983 On macOS 27, views inside an NSStatusItem button no longer receive hover or mouse-movement events. The same code works correctly on macOS 26. What I tried: An NSTrackingArea attached to a subview of NSStatusBarButton An NSTrackingArea attached directly to the status-bar button Replacing NSStatusItem.view with a custom view Embedding an NSHostingView and using SwiftUI onHover/onContinuousHover NSStatusItem button highlight cannot be set programmatically. - FB23330269 The following code no longer has any effect (does not provide the highlight capsule): NSStatusItem.button?.highlight(true) NSStatusItem window occlusionState no longer reflects hidden menu bar visibility - FB23349447 The following no longer works: statusItem.button?.window?.occlusionState.contains(.visible) These changes may be related to some of the touch related changes or maybe it's about how menu items are now seemingly more "managed" in a way that their position, visibility may change in a way that is transparent/undetectable to the app.
Replies
6
Boosts
2
Views
1k
Activity
Aug ’26
NSSearchToolbarItem cancel button triggers action before clearing text and before the ending search notification
I am trying to use an NSSearchToolbarItem using AppKit directly in Objective-C. If I perform a search and then click the cancel icon, my target/action is called while the NSSearchField still contains the search text (not yet cleared) and the delegate has not yet received the ending search invocation. In other words, it looks exactly the same as if the user had submitted the same search twice. Google's AI suggested using the controlTextDidChange method, but that was deprecated long ago. My current solution is to ignore searches that appear redundant (although they may not be, if the data being searched changes). This is on macOS 26.6.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
0
Boosts
0
Views
450
Activity
Aug ’26
Finder Sync: Opening a floating NSPanel from a Finder context menu
Hi! I'm experimenting with a macOS app using Finder Sync, and I'd like to make sure I'm heading in the right direction before I build too much. The workflow I'm aiming for is: • Right-click a folder in Finder • Choose "Create Sticky Note" • Get the selected folder URL • Launch (or activate) the main app • Open a small floating NSPanel that's associated with that folder The panel itself would live in the main app, not inside the Finder extension. The goal is simply to store notes associated with a specific folder. A few questions: Is Finder Sync the right technology for this kind of workflow, or is there a better API I should be looking at? Is opening a floating NSPanel from a Finder context menu (via the main app) a reasonable architecture on current versions of macOS? What's the preferred way for a Finder Sync extension to communicate with the main app these days? XPC? App Groups? Distributed Notifications? Something else? Are there any sandbox or App Store review limitations I should be aware of with this approach? I'd really appreciate any advice or examples from anyone who's built something similar. Thanks! P.S. English isn't my first language, so AI helped me with the writing—but the questions are mine. 😄
Topic: UI Frameworks SubTopic: AppKit
Replies
0
Boosts
0
Views
397
Activity
Aug ’26
window:willUseFullScreenPresentationOptions: with NSApplicationPresentationHideDock causes other windows to be unminimizable
In the below code, I create two windows, and use a window delegate to make sure that whenever the first is fullscreened, its menubar and dock are hidden properly. However, when I fullscreen the first window and go back to the desktop to see my second window, the second window's minimize button is grayed out and using miniaturize on it will not work either. I've tried various things; it seems like if I fullscreen the second window and the unfullscreen it, it then becomes minimizable without additional side effects. Is there any reason why this is happening? This seems like a bug in AppKit... so how do I work around it programmatically? #import <Cocoa/Cocoa.h> @interface AppDelegate : NSObject <NSApplicationDelegate, NSWindowDelegate> @property (strong) NSWindow *mainWindow; @property (strong) NSWindow *secondaryWindow; @end @implementation AppDelegate - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { NSRect mainRect = NSMakeRect(100, 300, 400, 300); self.mainWindow = [[NSWindow alloc] initWithContentRect:mainRect styleMask:(NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskResizable) backing:NSBackingStoreBuffered defer:NO]; [self.mainWindow setTitle:@"Main Window (Go Fullscreen Here)"]; [self.mainWindow setDelegate:self]; NSTextField *mainLabel = [NSTextField labelWithString:@"1. Click the green zoom/fullscreen button on THIS window.\n\n2. Look at the other window's yellow minimize button."]; [mainLabel setFrame:NSMakeRect(20, 100, 360, 100)]; [[self.mainWindow contentView] addSubview:mainLabel]; [self.mainWindow makeKeyAndOrderFront:nil]; NSRect secondaryRect = NSMakeRect(550, 300, 400, 300); self.secondaryWindow = [[NSWindow alloc] initWithContentRect:secondaryRect styleMask:(NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskResizable) backing:NSBackingStoreBuffered defer:NO]; [self.secondaryWindow setTitle:@"Secondary Window (The Victim)"]; NSButton *testButton = [NSButton buttonWithTitle:@"Try code [window miniaturize:]" target:self action:@selector(attemptProgrammaticMinimize:)]; [testButton setFrame:NSMakeRect(80, 130, 240, 40)]; [[self.secondaryWindow contentView] addSubview:testButton]; [self.secondaryWindow makeKeyAndOrderFront:nil]; } - (NSApplicationPresentationOptions)window:(NSWindow *)window willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions { return NSApplicationPresentationFullScreen | NSApplicationPresentationHideMenuBar | NSApplicationPresentationHideDock; } - (void)attemptProgrammaticMinimize:(id)sender { [self.secondaryWindow miniaturize:nil]; NSLog(@"[Repro] Minimize attempted"); } - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender { return YES; } @end int main(int argc, const char * argv[]) { @autoreleasepool { NSApplication *app = [NSApplication sharedApplication]; [app setActivationPolicy:NSApplicationActivationPolicyRegular]; AppDelegate *delegate = [[AppDelegate alloc] init]; [app setDelegate:delegate]; [app activateIgnoringOtherApps:YES]; [app run]; } return 0; }
Replies
3
Boosts
0
Views
861
Activity
Aug ’26