Skip to content

fix(capture): align Windows cursor coordinates with DPI - #80

Merged
ExtraBinoss merged 1 commit into
masterfrom
fix/windows-cursor-dpi-scaling
Sep 14, 2026
Merged

ExtraBinoss merged 1 commit into
masterfrom
fix/windows-cursor-dpi-scaling

Conversation

@ExtraBinoss

@ExtraBinoss ExtraBinoss commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • configure the Windows capture engine as Per-Monitor V2 before WGC and cursor workers start
  • record the selected display scale as a backward-compatible metadata event in cursor.json
  • keep metadata out of cursor playback, telemetry, and shape catalogs

Validation

  • cargo test -p capture display_scale_metadata_survives_finalization_without_telemetry_or_shapes
  • cargo test -p capture --bin capture-engine
  • cargo check -p capture --bin capture-engine --tests --target x86_64-pc-windows-gnu
  • cargo clippy -p capture --bin capture-engine --tests --target x86_64-pc-windows-gnu -- -D warnings
  • bunx vitest run src/components/video-editor/composables/tests/cursorPlayback.test.ts
  • bun run typecheck
  • bun run typecheck:vue

Summary by CodeRabbit

  • New Features

    • Improved Windows capture support for mixed-DPI and multi-monitor setups.
    • Cursor recordings now preserve display scaling information, improving cursor positioning across monitors.
    • Added support for cursor metadata during recording and playback.
  • Bug Fixes

    • Fixed cursor playback behavior so metadata before the first movement does not affect timeline state.
    • Ensured cursor metadata is retained without being included in telemetry data.

Copilot AI lite review requested due to automatic review settings September 14, 2026 12:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ExtraBinoss
ExtraBinoss merged commit 43edf56 into master Sep 14, 2026
14 of 17 checks passed
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 079639ab-e8d4-4738-ba62-a0beb0165d6a

📥 Commits

Reviewing files that changed from the base of the PR and between e6d370a and dbdf00a.

📒 Files selected for processing (11)
  • packages/capture/Cargo.toml
  • packages/capture/src/bin/capture-engine.rs
  • packages/capture/src/bin/capture_engine_tests/mod.rs
  • packages/capture/src/cursor/backend.rs
  • packages/capture/src/cursor/recording_support_tests.rs
  • packages/capture/src/cursor/win/capture.rs
  • packages/capture/src/cursor/win/recording.rs
  • packages/capture/src/screen/linux/cursor_buttons.rs
  • packages/capture/src/session/recording_active.rs
  • src/api/types/capture-session.ts
  • src/components/video-editor/composables/tests/cursorPlayback.test.ts

📝 Walkthrough

Walkthrough

Windows capture now enables per-monitor-V2 DPI awareness and records monitor display scale in cursor metadata. Windows source resolution passes scale through recording. Cursor serialization, telemetry filtering, timeline ordering, TypeScript types, and playback tests support the new metadata event.

Changes

Windows cursor metadata

Layer / File(s) Summary
Per-monitor DPI awareness
packages/capture/Cargo.toml, packages/capture/src/bin/capture-engine.rs, packages/capture/src/bin/capture_engine_tests/mod.rs
The Windows dependency enables Shell APIs. The capture engine configures and validates per-monitor-V2 DPI awareness. A child-process test checks process and thread DPI contexts.
Windows source scale propagation
packages/capture/src/cursor/backend.rs, packages/capture/src/cursor/win/capture.rs, packages/capture/src/cursor/win/recording.rs, packages/capture/src/session/recording_active.rs, packages/capture/src/screen/linux/cursor_buttons.rs, packages/capture/src/cursor/recording_support_tests.rs
Windows source resolution returns the capture region and optional display scale. Recording emits a CursorEvent::Metadata event. Metadata participates in event ordering, remains excluded from telemetry, and is covered by finalization tests.
Playback metadata contract
src/api/types/capture-session.ts, src/components/video-editor/composables/tests/cursorPlayback.test.ts
The TypeScript cursor-event union includes metadata. Playback tests verify that metadata before movement does not change cursor state.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant ActiveRecordings
  participant WindowsSource
  participant CursorRecording
  participant CursorFiles
  participant CursorPlayback
  ActiveRecordings->>WindowsSource: resolve region and display scale
  ActiveRecordings->>CursorRecording: start with source context
  CursorRecording->>CursorFiles: write metadata and cursor events
  CursorFiles->>CursorPlayback: provide cursor event stream
  CursorPlayback->>CursorPlayback: ignore metadata for cursor state
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/windows-cursor-dpi-scaling

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ExtraBinoss
ExtraBinoss deleted the fix/windows-cursor-dpi-scaling branch September 14, 2026 12:02
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.

2 participants