X11 background input silently no-ops on synthetic-dropping toolkits with unlisted WM_CLASS

Author: code-yeongyuCreated Sep 28, 2026Updated Sep 28, 2026

Summary

X11 background input decides whether a target toolkit drops synthetic (XSendEvent) events by matching the window's WM_CLASS only (crates/senpi-desktop-backend-x11/src/input/toolkit_filter.rs). A GTK/Qt/VCL/Chromium application whose WM_CLASS is not in the list gets XSendEvent input that it silently drops, while the action reports success.

Expected

Detect synthetic-dropping toolkits the way oh-my-pi does (linux/x11/toolkit.rs:10-78): in addition to WM_CLASS, read /proc/<pid>/maps of the window's _NET_WM_PID for libgtk-3/libgtk-4, libvcl, libmergedlo, libQt5Gui, libQt6Gui, libxul, libcef, and recognise Chromium/Electron through --type= helper children. A matching target gets an honest BackgroundUnavailable refusal instead of a silent no-op. Core-only clients (xterm, Tk via libtk8/libtk9, Motif via libXm) keep XSendEvent. The refusal names ax.perform first, then foreground input.

Actual

Classification by WM_CLASS alone; unknown class names fall through to XSendEvent.

Evidence / status

Found by code comparison during the computer-use ship-readiness pass (reference: oh-my-pi linux/x11/toolkit.rs:7-78). Not yet reproduced against a real application with an unlisted WM_CLASS; severity P2 (false success only for toolkits with unusual class names; common GTK/Qt/Chromium classes are already covered).

Acceptance criteria

  • Unit tests with a fake /proc/<pid>/maps for each library family and for a Chromium helper tree.
  • Xvfb QA: a GTK3 test window given an unlisted WM_CLASS is refused with BackgroundUnavailable (before: silent success, no effect); xterm still receives XSendEvent input.

Related

The deferred MPX background-input port filed alongside this issue.

Source: code-yeongyu/oh-my-openagent