Skip to content

Conversation

@relh
Copy link

@relh relh commented Dec 5, 2025

Add getScreens on Linux. For X11, return the default screen as the primary monitor. For Wayland, bind wl_output, capture geometry/mode/scale, normalize mode by scale into logical coordinates, prefer current → preferred → first mode, and fall back to a single 1920×1080 primary when no outputs are advertised. Platform dispatch now includes Wayland when compiled with -d:wayland, otherwise X11.

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

@treeform treeform left a comment

Choose a reason for hiding this comment

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

just X11

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
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
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
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

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