Skip to content

X11: select one monitor with UU_X11_MULTISCREEN=1 (#98) - #100

Merged
VallierDev merged 1 commit into
mainfrom
feat/x11-multiscreen
Oct 23, 2026
Merged

VallierDev merged 1 commit into
mainfrom
feat/x11-multiscreen

Conversation

@VallierDev

Copy link
Copy Markdown
Owner

Closes nothing yet: #98 stays open until the reporter confirms on real hardware.

X11 captures the whole root window, so two side-by-side monitors reach the viewer as one 3840×1080 picture. This adds an opt-in mode (default off, single-screen hosts unchanged):

  • UU_X11_MULTISCREEN=1: monitors come from xrandr --listmonitors (read once at start, two or more required). The primary, or UU_X11_OUTPUT, is id 0; the rest go left to right. They are advertised and switched through the existing screen-switch path used for Hyprland (wayland::outputs / select, CaptureSettingRequest field 4 / SimpleAction 8 screen_id).
  • Capture: x11grab reads display+x,y at the monitor size. The in-process engine (inproc-av, not in release builds) is skipped while a region is captured.
  • Input: absolute XTest/uinput positions add the selected monitor's offset (uinput scales by the root size).
  • The viewer's 分辨率 does not change the display mode in this mode (it would resize one output of a multi-monitor layout); the stream is scaled instead.
  • CaptureSettingSync reports the monitor size (sync_native).

Verification:

  • Unit tests: x11_monitors_keep_their_root_offsets (the xrandr output from X11 双显示器被拼接为一张画面,希望支持单屏选择/切换 #98, virtual monitors, preferred output, malformed lines). cargo test 246 passed on macOS and on Debian 13.
  • On Debian 13 with Xtigervnc split into two 1920×1080 RandR monitors: the ignored test absolute_pointer_lands_on_the_selected_x11_monitor passes (pointer lands at monitor offset + mapped point for both monitors, switching back and forth). x11grab with :N+0,0 / :N+1920,0 returns the left (red) and right (blue) halves respectively.
  • Not yet tested: switching from the official clients on real dual monitors. That is asked of the reporter in X11 双显示器被拼接为一张画面,希望支持单屏选择/切换 #98 after release.

🤖 Generated with Claude Code

X11 sends the whole root, so side-by-side monitors arrive as one wide picture.
With UU_X11_MULTISCREEN=1 the host lists the RandR monitors (xrandr
--listmonitors, read at start; primary or UU_X11_OUTPUT first, then left to
right) through the existing Hyprland screen-switch path. x11grab reads
display+x,y at the monitor size, XTest/uinput absolute input adds the monitor
offset, and the in-process engine and the xrandr resize are skipped while a
monitor region is captured (分辨率 scales the stream).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@VallierDev

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T13:51:09.519490Z 5cff355 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 5cff35569a

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@VallierDev
VallierDev merged commit 69aecf0 into main Oct 23, 2026
6 checks passed
@VallierDev
VallierDev deleted the feat/x11-multiscreen branch October 23, 2026 13:51
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