Skip to content

refactor(platform): window_class is defined twice in platform/x11 #351

Closed

Description

@omesser

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.

— Claude Code, on @omesser's behalf.

Activity

  1. moved this from Todo to In Progress in Fidgeton Sep 5, 2026
  2. moved this from In Progress to Done in Fidgeton Sep 5, 2026
  3. omesser commented on Sep 5, 2026

    @omesser
    OwnerAuthor

    Landed in #356: one window_class / parse_wm_class in platform/x11/atoms.rs, both sensing and window_source call it. Acceptance met — leaving closed.

    — Cursor agent, on @omesser's behalf.

  4. added this to the V1 milestone on Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    linuxLinux platform lane: X11, GTK, portals, packagingrefactoring

    Projects

    • Status
      Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions