kitty icon indicating copy to clipboard operation
kitty copied to clipboard

[macOS 26.7.1] AXWindows returns the application element instead of kitty's windows

Open pasha-omni opened this issue 1 month ago • 1 comments

Describe the bug

On macOS 26.7.1, kitty no longer exposes its OS windows through the Accessibility API. Each query that should return a window returns the kitty application element instead:

  • AXWindows on the app element returns one element. Its AXRole is AXApplication, it has no AXSubrole, no AXPosition, and _AXUIElementGetWindow fails on it (-25201).
  • AXFocusedWindow and AXMainWindow return the same application element.
  • AXUIElementCopyElementAtPosition at a point inside a kitty window also returns the application element.

So window managers and other Accessibility clients cannot see, move or resize kitty windows. Other apps on the same machine (for example Chrome) still return normal AXWindow / AXStandardWindow elements.

This started after the update from macOS 26.6.1 to 26.7.1. Before the update, with kitty 0.48.1, the same client moved kitty windows correctly. kitty 0.48.1 and 0.49.2 both show the bug on 26.7.1.

To Reproduce

  1. Start kitty --config NONE.
  2. From a process that has the Accessibility permission, read the windows of the kitty process:
import AppKit
import ApplicationServices

for app in NSWorkspace.shared.runningApplications
where app.bundleIdentifier == "net.kovidgoyal.kitty" {
    let appElement = AXUIElementCreateApplication(app.processIdentifier)
    var value: CFTypeRef?
    AXUIElementCopyAttributeValue(appElement, kAXWindowsAttribute as CFString, &value)
    for window in value as? [AXUIElement] ?? [] {
        var role: CFTypeRef?
        AXUIElementCopyAttributeValue(window, kAXRoleAttribute as CFString, &role)
        print(app.processIdentifier, role as? String ?? "nil")
    }
}
  1. See AXApplication printed for the window, where AXWindow is expected.

Environment details

kitty 0.49.2 (also 0.48.1), started with --config NONE
macOS 26.7.1 (25G241), arm64

Additional context

The bug reproduces with kitty --config NONE, so no config is needed. The window list in CGWindowListCopyWindowInfo is correct: it shows each kitty window at its real position. Only the Accessibility tree is wrong.

pasha-omni avatar Oct 22 '26 19:10 pasha-omni

Correction: this is a macOS bug, not a kitty bug. On 26.7.1 (25G241), TextEdit and a plain AppKit app with one NSWindow and no accessibility code show the same thing: AXWindows returns the application element. Chrome is not affected. Overriding accessibilityWindows / accessibilityChildren on NSApplication, or the role and subrole on NSWindow, does not change the result, so I don't think kitty can work around it.

I reported it to Apple as FB25289632. Feel free to close this.

pasha-omni avatar Oct 22 '26 20:10 pasha-omni