Skip to content

Add Linux screen detection to Windy#149

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

Add Linux screen detection to Windy#149
relh wants to merge 4 commits into
treeform:masterfrom
relh:feature/linux-getScreens

Conversation

@relh

@relh relh commented Dec 5, 2025

Copy link
Copy Markdown

Summary

getScreens() was only available on Windows and macOS. Linux callers had no screen enumeration path.

This PR adds Linux support. On X11, it returns the default screen as the primary monitor. On Wayland, it binds wl_output, reads output geometry, mode, and scale, converts the mode into logical coordinates, and falls back to one 1920x1080 primary screen when no outputs are advertised. Linux platform dispatch now uses Wayland when compiled with -d:wayland; otherwise it uses X11.

Verification

  • No test command was recorded on the original PR.
@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
when defined(windows) or defined(macosx):
# Screens API only currently supported on Windows and macOS

when defined(windows) or defined(macosx) or defined(linux) or defined(emscripten):

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.

where is emscripten?

include x11
# include x11_2
when defined(wayland):
include wayland

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.

plz

## Minimal screen enumeration for X11. Returns the default screen as primary.
init()

let s = display.screen(display.defaultScreen)

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.

it should return all of the screen

@relh relh changed the title Add Linux getScreens X11/wayland fallback Add Linux screen detection to Windy Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants