Skip to content

Sway support #4

Closed
Closed

Description

@jtagcat
[WARNING] drivers.factory: Unknown desktop 'SWAY' but DISPLAY is set. Using X11 driver as fallback.

Activity

  1. JADRT22 commented on Oct 10, 2026

    @JADRT22
    Owner

    Fixed in main — added src/drivers/sway.py, driven through the swaymsg seat IPC (cursor move/set/press/release, button4/button5 for scroll). Detection now checks SWAYSOCK first, then XDG_CURRENT_DESKTOP, so the X11 fallback warning shouldn't fire on Sway anymore.

    One caveat worth knowing: the sway IPC has no query for the cursor position, so Sway records relative motion (like the GNOME driver does). cursor set still warps absolute at replay for start_pos/pos events, but absolute recording isn't possible there. Details in the README and the issue link there.

    Not tested by me — if you're on Sway, git pull && ./tools/install.sh and tell me if anything's off: clicks, scroll, or relative drift. Test suites cover the driver logic (mocked IPC) but not a live compositor.

  2. JADRT22 commented on Oct 10, 2026

    @JADRT22
    Owner

    Follow-up: I ran the driver against a live sway (1.12, headless on a private SWAYSOCK, so my own session was untouched) and it works — but the run caught two bugs the mocked tests could not:

    1. swaymsg answers commands with a JSON array ([{success: true}]), not a bare object, so every cursor move, button and scroll was reporting failure.
    2. Its getopt eats negative coordinates: cursor move -30 40 reached sway as cursor move 40.

    A third one was in the driver all along: the command string was passed as a single argv entry, so -t get_seats arrived as a literal message type (Unknown message type get_seats) — which silently made seat detection fall back to seat0 and resolution to 1920×1080.

    All three are fixed in main and covered by regression tests. Verified against the live compositor: seat seat0, resolution 1024×768 read from get_outputs, cursor move 10 -5 arriving intact, warp + clamp to the last pixel, button press/release, and button4/button5 scroll — every one answered success: true. README status table now lists Sway as author-tested instead of "implemented, not tested".

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions