rust-windowing / rust-windowing/winit

Allow specifying `MonitorHandle` when constructing a `Window`

Open
#4,468 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

S - enhancement
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

Description

I recently encountered a papercut in egui where my application does not save the last Window it was added to. While looking at how I might implement this feature, I noticed that while the MonitorHandle documentation states:

Allows you to retrieve information about a given monitor and can be used in Window creation.

The WindowAttributes struct used for constructing a Window does not allow you to specify a MonitorHandle in order to control where the monitor is constructed.

I'm unsure if there are technical blockers at play here that prevent this from being possible. For example, someone in the egui discord mentioned that Wayland could possibly be problematic. I'm opening this issue for discussion with intent to later do the work involved.

As an aside I should create a separate issue for this, but it may be nice to have a way to uniquely identify a monitor beyond its name (which may have collisions?).

Relevant platforms

Windows

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the winit MonitorHandle, WindowAttributes, and Window APIs, then inspect the platform behavior relevant to Windows and Wayland. Determine whether a monitor can be specified during window construction across the supported platforms, document any blockers, and define the resulting API behavior before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.