Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- `accessibility_tree`, `find_ui_elements`, `wait_for_element`, `list_windows`, and `focus_window` now work in isolated virtual sessions on Fedora and other distros that install AT-SPI binaries outside `/usr/lib` (e.g. `/usr/libexec`). Binary paths are now extracted from D-Bus service files instead of being hardcoded.
- Isolated virtual sessions now explicitly start `at-spi2-registryd` and set `IsEnabled=true` on the AT-SPI bus. Without a session manager, the registryd auto-activation failed silently, causing `accessibility_tree` to return "(no accessible applications found)".

## [0.7.0] - 2026-03-29

### Added
Expand Down
27 changes: 24 additions & 3 deletions src/kwin_mcp/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,30 @@ def _build_wrapper_script(self, config: SessionConfig) -> str:
# Start the AT-SPI accessibility bus.
# ATSPI_DBUS_IMPLEMENTATION is set in _build_env() to force dbus-daemon
# instead of dbus-broker (which reuses the host's AT-SPI bus).
/usr/lib/at-spi-bus-launcher --launch-immediately &
AT_SPI_PID=$!
sleep 0.2
# Extract the binary path from the D-Bus service file so this works on
# any distro (Fedora /usr/libexec, Arch /usr/lib, Debian /usr/lib/at-spi2-core, etc.)
AT_SPI_LAUNCHER=$(sed -n 's/^Exec=\\([^ ]*\\).*/\\1/p' \\
/usr/share/dbus-1/services/org.a11y.Bus.service 2>/dev/null)
if [ -x "$AT_SPI_LAUNCHER" ]; then
"$AT_SPI_LAUNCHER" --launch-immediately &
AT_SPI_PID=$!
sleep 0.2

# Enable AT-SPI so apps register with the accessibility bus
dbus-send --session --dest=org.a11y.Bus --type=method_call \\
/org/a11y/bus org.freedesktop.DBus.Properties.Set \\
string:org.a11y.Status string:IsEnabled variant:boolean:true 2>/dev/null

# Start the AT-SPI registry daemon. The .service file specifies
# --use-gnome-session which fails without a session manager, so we
# extract just the binary path and start it without that flag.
AT_SPI_REGISTRYD=$(sed -n 's/^Exec=\\([^ ]*\\).*/\\1/p' \\
/usr/share/dbus-1/accessibility-services/org.a11y.atspi.Registry.service 2>/dev/null)
if [ -x "$AT_SPI_REGISTRYD" ]; then
"$AT_SPI_REGISTRYD" &
fi
sleep 0.2
fi

# Pre-set D-Bus activation environment BEFORE starting KWin.
# When KWin triggers portal auto-activation, portal-kde will get
Expand Down