rust-windowing / rust-windowing/winit

linux (kwin+x11): window opening at full height

Open
#745 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I'm trying to find the root cause of alacritty #1817. I've determined that the issue was introduced in 1b74822cfc0cb7fba4ed4940a3faae9499fcda95. The problem does not occur on wayland unless running over XWayland.

If I build alacritty against that commit I've found that commenting out the following block from src/platform/linux/x11/mod.rs fixes the incorrect window size.

/*                    if last_hidpi_factor != new_hidpi_factor {
                        events.dpi_changed = Some(WindowEvent::HiDpiFactorChanged(new_hidpi_factor));
                        let (new_width, new_height, flusher) = window.adjust_for_dpi(
                            last_hidpi_factor,
                            new_hidpi_factor,
                            width,
                            height,
                        );
                        flusher.queue();
                        shared_state_lock.dpi_adjusted = Some((new_width, new_height));
                    }
*/

I haven't had much luck minimizing the problem further. I have also built against v0.18.0 and the problem still exists. Removing the equivalent section of code doesn't help either. Any help in narrowing down this issue is appreciated.

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

Reproduce the incorrect window height under Linux X11 or XWayland, then compare the behavior around commit 1b74822cfc0cb7fba4ed4940a3faae9499fcda95. Read src/platform/linux/x11/mod.rs, especially the shown HiDpiFactorChanged block and its equivalent in v0.18.0. Done means the root cause is isolated and the window sizing behavior is corrected without regressing Wayland.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, rust
Domain
desktop
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.