You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(platform): window_class is defined twice in platform/x11 #351
Found while reviewing #326. Verified on main at d38d3f2f.
Why
window_class is defined twice, verbatim, in the same directory:
platform/x11/sensing.rs:56
platform/x11/window_source.rs:303
Both read WM_CLASS off a window and hand back the instance name. Both are
private to their module, so nothing enforces that they agree. WM_CLASS is
the string a user types into Excluded applications, so the two copies drifting
means exclusion works for sensing and not for geometry, or the reverse — and
the only place that would show up is a Linux desktop.
platform/x11/atoms.rs already exists for exactly this: #268 pulled three
duplicated intern_atom helpers into one place.
What to do
One window_class, in the module that already owns shared X11 plumbing. atoms.rs holds the interned atoms; either that file or a sibling is the
right home. Both callers take a &RustConnection and a Window, so the
signature is already common.
Acceptance
One definition, called from both sites.
A unit test pins what it returns for a WM_CLASS of instance\0Class\0,
and for a window that has none.
Ubuntu CI green.
Out of scope
Changing which name is matched. If WM_CLASS instance versus class is the
wrong choice for Excluded applications, that is its own question — #186's
territory, not this one.
Activity
omesser commentedon Sep 5, 2026
Landed in #356: one
window_class/parse_wm_classinplatform/x11/atoms.rs, both sensing and window_source call it. Acceptance met — leaving closed.— Cursor agent, on @omesser's behalf.