Repository navigation
feat(window): rune::displays() reads the current displays while running - #2209
Merged
Merged
Conversation
opencodejr
Bot
force-pushed
the
bot/issue-146
branch
from
November 25, 2026 08:40
116553e to
f390416
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #146: the first ask, a display query that works while the app runs. It does not close the issue. Still open: a display-change callback (ask 2, which needs native hooks on macOS, Windows, X11 and Wayland),
ConfiguredOverlayoverlays created afterrun, aTx/AppHandleform of the query, and the issue's 'Done when'.rune::displays() -> Vec<Display>(crates/rune/src/window/displays.rs). Called on the UI thread, it reads monitors from the first open native window (winit'sWindow::available_monitorsandprimary_monitor;Windowalso provides the display handle for the Wayland output query). It returns the fields arun_windowsfactory gets, so an app can find a monitor plugged in after launch andopen_windowaWindowOptions::overlayon it.Weak<Window>: main windows inwindow/host/create.rs, overlays inoverlay/lifetime.rs, the web canvas inplatform/web.rs. A smallMonitorstrait implemented forActiveEventLoopandWindowlets the factory's startup list (moved out ofresumed) anddisplays()share one reading path, including the Wayland output resolution.reset()clears the saved windows and the list at the start of every native and headless run, so one run never sees the previous run's displays. On another thread the list is empty.reset()(window/displays_tests.rs).Testing: not compiled or run. The environment that made this change had no Rust toolchain, so
cargo check --workspace --all-targets,cargo lintandcargo test -p runestill need to run.scripts/file-size.shpasses and the public-repo hygiene grep is clean. Nothing was tried with a monitor plugged in or removed. Whether a new monitor appears depends on winit'sWindow::available_monitors()returning current monitors on each platform, which needs checking on X11 and Wayland in particular.Closes #146