Port GUI to eframe/egui, add Linux support, cross-platform autostart, and CI/release updates - #15
Merged
Conversation
…ll thread HidApi::refresh_devices(), triton::list_candidates() and OpenSlot::open() all ran on the controller-reader thread, serialized ahead of read_one() once a second. All three block for as long as the OS takes, so live reads stopped for the whole scan. The reporter in #16 measured refresh_devices() at ~195-210ms on Windows with many HID devices attached, matching the reported 50-500ms freeze every 1-2 seconds. It hid in the stats because a 200ms gap barely moves a per-second average, and no stale-sample check fires: read_one() simply returns nothing during the gap. Reproduced on Linux by injecting the reported 200ms cost into the scan block: 12 stalls in 15s, 211-216ms each, 17.2% of wall time, with the sample rate still reading 248/s. With discovery on its own thread the same injected cost yields zero gaps over 20ms (max 10ms), and even a 2s cost stays clean. A controller-scanner thread now owns HidApi and hands opened devices to the reader over a channel; a shared path set keeps the two from double-opening and releases paths when a controller drops, so reopen-after-silence still works. Interfaces that refuse to open back off exponentially (1s to 60s) instead of being retried every second, and reset when the path leaves enumeration. Multi-slot receivers expose one interface per slot and the unpaired ones fail every time; retrying them cost a blocking open apiece and flooded the log. Backoff rather than the permanent skip suggested in #16, so pairing a controller to an empty slot is still picked up without a restart. Closes #16 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The Linux build linked 74 shared libraries, including GTK3, libxdo, libayatana-appindicator, atspi and libudev, so it only ran on a machine with the same desktop stack installed as the one that built it. Nearly all of it came from one crate: tray-icon pulls in muda, which links libxdo and the whole GTK stack. Linux now speaks the StatusNotifierItem D-Bus protocol directly through ksni, and hidapi uses its pure-Rust hidraw backend instead of the C one that needs libudev. Windows keeps tray-icon and the default hidapi backend. Behaviour is unchanged: libayatana-appindicator is itself a StatusNotifierItem implementation, so the same desktops show the same tray. The binary now links libc, libm and libgcc_s and nothing else; X11, Wayland and OpenGL are dlopened by winit and glutin at runtime, as they must be to use the system's GPU drivers. Verified end to end on the Proteus Puck: controller opens, DSU streams at 248 packets/s, tray registers with plasmashell. This also removes the GTK main-loop thread the tray previously needed, since ksni is pure D-Bus and has no thread affinity. Cargo.lock was regenerated: it still described the pre-eframe dependency tree, 90 packages with no eframe or tray-icon in it, so --locked builds could not work. The refresh also moves hidapi to 2.6.6, which fixes the pure-Rust backend sending HIDIOCSFEATURE with _IOC_WRITE instead of the kernel's _IOC_WRITE|_IOC_READ; on 2.6.5 every feature report failed with EINVAL and the controller never opened. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ability The release workflow on main built only a Windows exe, which is why v0.2.0 shipped a single sc2dsu-v0.2.0.exe asset. It now builds both targets and publishes them with SHA256SUMS.txt. The Linux release builds on a pinned ubuntu-22.04 rather than ubuntu-latest. A glibc-linked binary runs on any glibc at or above the one it was built against and never below, so building on the newest image would produce a binary that refuses to start on Debian 12, Ubuntu 22.04 or SteamOS. 22.04 gives a glibc 2.35 floor. check-linux-portability.sh fails the build if the binary links anything outside the set every distribution has, or needs a glibc above the limit. A single crate with a C dependency silently undoes the portability work, and without a gate that is only discovered by whoever downloads the release. The release build enforces the glibc bound; CI passes "any" because its runner image floats. Both workflows now build with --locked. No apt packages are installed for the Linux build any more because nothing needs them: the final link line requests no external libraries at all. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Lets a pull request be tested on real hardware without cutting a tag or keeping a toolchain for the other platform installed locally. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
native-windows-gui/nwgtoeframe/eguiandtray-icon, replacing the old window layout, visualization, tray handling, and settings UI with an egui-based implementation and a newAppstruct andeframe::Appimplementation.src/autostart.rswith a Windows registry implementation and a Linux~/.config/autostart.desktopimplementation, plus a no-op fallback for other OSes, and exportedenable,disable, andis_enabled.README.md, updated config path documentation, and clarified CI behavior and supported platforms.Cargo.tomlto addeframeandtray-icon, removednative-windows-guideps, and adjustedwindows-sysfeatures.ci.ymlnow runs as a matrix onubuntu-latestandwindows-latest, installs Linux HID and desktop dependencies on Linux runners, runscargo fmt --check,cargo clippy,cargo test, andcargo build --release;release.ymlnow cross-builds Windows and Linux artifacts, stages and uploads per-platform artifacts, and creates a single release containing both.main.rs(attach_console) and wired the new GUI entry path toeframe::run_nativeinui.rs'srunfunction.Testing
cargo fmt --all -- --check,cargo clippy --all-targets -- -D warnings,cargo test, andcargo build --releaseon bothubuntu-latestandwindows-latestas part of the updated CI matrix, and those steps succeeded in the CI run.cargo testandcargo build --releasefor each platform, and those steps completed successfully in the release run.src/ui.rsforquat_rotateandcrossare included in thecargo testrun and passed.Codex Task