rust-windowing / rust-windowing/winit

Setting position on startup does not work reliably on X11

Open
#978 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

B - bug C - needs investigation DS - x11
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

This has been reported to Alacritty in https://github.com/jwilm/alacritty/issues/2561.

On X11, it seems like setting the startup mode after the window is show()n on an originally invisible window has some inconsistent behavior. I've tested this myself on i3.

When the window is created and set to fullscreen on window.get_current_monitor() right at startup, the window is fullscreened on the incorrect monitor.

Additionally, if the position is set right after show() too, the window is fullscreened on the incorrect monitor and when leaving fullscreen mode the position is not what it has been set to.

If set_fullscreen is manually called on a keyboard event at a later point in time, both of these work without any issue.

See https://github.com/rust-windowing/winit/issues/978#issuecomment-705223820.

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 reproducing the startup fullscreen and positioning behavior on X11 with i3, comparing startup calls with a later keyboard-triggered fullscreen change. Use the linked Alacritty and winit issue discussion as context. Done means fullscreen startup targets the selected monitor and leaving fullscreen restores the configured position.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.