Skip to content

Fix native streamer fullscreen monitor placement#505

Open
capy-ai[bot] wants to merge 4 commits into
devfrom
capy/fix-native-fullscreen-monitor
Open

Fix native streamer fullscreen monitor placement#505
capy-ai[bot] wants to merge 4 commits into
devfrom
capy/fix-native-fullscreen-monitor

Conversation

@capy-ai

@capy-ai capy-ai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep the Windows external native renderer guard alive for the full stream session so fullscreen/window changes continue to apply
  • derive the external renderer target from the Electron render surface HWND and client rect instead of the renderer window's startup monitor
  • use that target rect for renderer placement and cursor clipping, allowing fullscreen toggles and secondary-monitor placement to follow the app window

Fixes #497

Verification

  • cargo check --manifest-path native/opennow-streamer/Cargo.toml
  • cargo check --manifest-path native/opennow-streamer/Cargo.toml --features gstreamer
  • cargo test --manifest-path native/opennow-streamer/Cargo.toml
  • cargo test --manifest-path native/opennow-streamer/Cargo.toml --features gstreamer

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai capy-ai Bot added the capy Generated by capy.ai label Jun 5, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f4501721df

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +407 to +408
render_rect_to_screen_rect(window_handle as Hwnd, rect)
.or_else(|| monitor_rect_for_window(window_handle as Hwnd))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Recompute the target rect instead of caching screen coordinates

When the Electron BrowserWindow is dragged to another monitor without being resized, the renderer only publishes surface updates for resize/fullscreen/visibility/visualViewport changes (StreamView.tsx), so no new update is sent on a pure window move. This converts the HWND-relative client rect into screen coordinates once and caches only that Rect; the guard then keeps using stale screen coordinates for SetWindowPos and ClipCursor, leaving the external renderer on the old monitor until some later resize/fullscreen event forces another surface update. Store the HWND plus client rect and recompute the screen rect in the guard loop, or have the main process publish move events.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capy Generated by capy.ai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant