Skip to content

Winit example crashes on wayland with dpi scaling #523

@TXPGhost

Description

@TXPGhost

The winit example crashes on my system (running GNOME under Wayland) with the following error:

wl_surface#25: error 2: Buffer size (1748x45) must be an integer multiple of the buffer_scale (2).

It seems to have something to do with the window decoration, since adding .with_decorations(false) to the window builder seems to be a workaround (or alternatively, by adding borderless: true to the WindowSettings when creating a three_d::Window). The size (1748x45) seems to suggest the issue lies with the window decorations.

The issue is also fixed by using 100% UI scaling rather than 200% (changed in the GNOME settings menu).

The crash seems to occur on line main.rs:73 of the winit_window example while the buffers are swapped.

context.swap_buffers().unwrap();

I also tested the eframe and pixels crates under the same conditions, and they were able to run fine, suggesting the issue is not upstream. Any ideas what may be causing this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions