Skip to content

fix: eleven bugs from review, from lost settings to recording the mic - #11

Merged
CubityFirst merged 1 commit into
mainfrom
fix/review-bugs
Nov 5, 2026
Merged

CubityFirst merged 1 commit into
mainfrom
fix/review-bugs

Conversation

@CubityFirst

Copy link
Copy Markdown
Owner

Fixes the eleven bugs from the code review, each with the smallest change that fixes it.

# Bug Fix
1 A hotkey that failed to register stopped settings (and first-run setup) being saved apply_settings keeps the first hotkey error, saves anyway, then shows it
2 An error mid-recording deleted the whole file Keeps and finishes the file once a frame was written; deletes only if nothing is usable; aborts still discard
3 Recordings checked for a clash with .png; the naming preview reseeded the shared RNG Naming::path_with_extension; the preview saves and restores the RNG state
4 QR text starting with non-ASCII crashed is_link uses str::get
5 Ctrl+Z / Ctrl+Y mid-drag panicked or corrupted annotations Ignored while a drag is in progress
6 Opening a file ran cmd /C start on the raw path ShellExecuteW
7 The corner preview showed up in the next capture WDA_EXCLUDEFROMCAPTURE on Windows, sharingType = none on macOS; on Linux it closes and the capture waits 500ms for it to go
8 macOS Retina: region recording mixed points and pixels; overlays used the main screen's scale Converts with each monitor's own scale
9 macOS and Wayland: monitors at different scales overlapped capture::untangle lays them out again, only when they overlap at different scales
10 Linux "What's playing" recorded the microphone pw-record with stream.capture.sink, falling back to parec @DEFAULT_MONITOR@; never the mic
11 Linux and macOS: a second launch did nothing A Unix socket in the config dir asks the running instance to show its window

Testing

  • Windows: cargo clippy --all-targets --locked is clean; cargo test --locked passes (187). The recording round trip still passes.
  • Linux (WSL Ubuntu): cargo test --locked passes (197). The only warnings were already there.
  • Live in Arch with nested Wayfire:
    • A second launch reaches the running instance.
    • "What's playing" records a tone played into the sink, not one played into the microphone.
    • On two monitors at scales 2 and 1, a screenshot and a recording of a region on the second monitor contain only its pixels.
  • Live on Windows: the corner preview is no longer in the next capture.
  • Not tested: macOS (no build here). Its changes are cfg-gated and reasoned only. Also untested: an actual display unplug during a recording.

Follow-up

  • On macOS, with screens at different scales, the recording border and bar and pinned images still go through winit's main-screen scale. That was already the case before this PR and isn't changed by it.

Reviewed with sol-loop: 4 rounds with gpt-6.1-sol on high. Sol verdict: approved

- A hotkey that can't be registered (macOS without Accessibility, no
  shortcuts portal, a key another app holds) no longer stops settings,
  first-run setup included, from being saved. The error still shows.
- An error partway through a recording keeps what was recorded, if the
  encoder can finish the file, and says it stopped early.
- Recordings check for a name clash with their own extension, so they no
  longer overwrite earlier ones. The naming preview puts the shared
  random generator back, so Secure pixelation stays unpredictable.
- Scanning a QR code whose text starts with non-ASCII no longer crashes.
- Ctrl+Z or Ctrl+Y mid-drag waits for the drag to end instead of
  corrupting the annotations or panicking.
- Opening a file uses ShellExecuteW instead of cmd /C start, so an & in
  its name can't break it or run a command.
- The corner preview stays out of the next capture: excluded from
  capture on Windows and macOS, and closed first on Linux, where the
  capture waits 500ms for it to go.
- macOS: region recording works in pixels on Retina screens, and
  overlays use each screen's own scale.
- macOS and Wayland: monitors at different scales no longer overlap, so
  a crop can't contain the other monitor's pixels.
- Linux: "What's playing" records the default sink's monitor through
  pw-record (or parec), never the microphone.
- Linux and macOS: launching snapr again shows the running one's window.
@CubityFirst
CubityFirst merged commit 0e452e8 into main Nov 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant