Skip to content

Return each X11 monitor so games can choose where to open - #149

Open
relh wants to merge 5 commits into
treeform:masterfrom
relh:feature/linux-getScreens
Open

relh wants to merge 5 commits into
treeform:masterfrom
relh:feature/linux-getScreens

Conversation

@relh

@relh relh commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

Games need each monitor’s position and size to place a window on the chosen display. The old change returned one rectangle covering the desktop, so it could not distinguish two monitors.

Use RandR 1.5 to return active monitor rectangles and their primary flags. This requires libXrandr and a server supporting RandR 1.5. The example prints the result on every supported platform, including the browser.

Validation: on a real Xvfb server configured with two 800 by 600 monitor regions, the old code returned one 1600 by 600 rectangle. The new test returns two distinct rectangles. A rendered check used those bounds to place two colored windows, one inside each region. This is virtual-monitor runtime evidence, not a physical multi-monitor or hot-plug test. The regression runs in the existing Linux CI job.

Updated to current upstream master. Addresses the existing request to return every screen.

The implementation checks passed on Linux, macOS, and Windows. The final change only moves this test step beside the screen example so it combines with the pending VSync PR; its final run has also passed on all three platforms. The runtime limits above still apply.

@relh relh changed the title Add Linux getScreens X11 fallback Add Linux getScreens X11/wayland fallback Dec 5, 2025

@treeform treeform left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

just X11

Comment thread examples/screens.nim Outdated
Comment thread src/windy/platforms/linux/platform.nim Outdated
Comment thread src/windy/platforms/linux/x11.nim Outdated
@relh relh changed the title Add Linux getScreens X11/wayland fallback Add Linux screen detection to Windy Jun 9, 2026
Return the default X11 screen as the primary screen so Linux callers can use the same API as the other platforms.
@relh
relh force-pushed the feature/linux-getScreens branch from dd667e9 to 5db2a77 Compare July 22, 2026 21:36
@relh relh changed the title Add Linux screen detection to Windy Support getScreens on X11 Jul 22, 2026

@relh relh left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[Codex, acting on behalf of relh]

Reviewed 5db2a77. The screen-enumeration concern in André's existing inline review remains unresolved: defaultScreen still produces one aggregate X11 screen rather than all attached monitors. The example's Linux guard has been removed, so that separate comment has been addressed. No additional distinct finding. I reviewed the current diff and existing thread; I did not run a multi-monitor X11 session.

@relh relh changed the title Support getScreens on X11 Return each X11 monitor so games can choose where to open Sep 9, 2026
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