Skip to content

Fixed width & height properties on Window are not respected on Linux #11448

@hulthe

Description

@hulthe

Bug Description

I am trying to set a fixed width/height on the Slint window.
This sometimes works, but sometimes the application ends up in a weird state where width/height of the window are fixed to the wrong values, but the root component still has the correct size.

Image

The green area is the expected window width/height.

The bug can be triggered in a few different ways:

  • On Gnome, by full-screening the window.
  • On COSMIC, by attempting to resize the window.
  • By using a tiling window manager (niri, hyprland)

IIRC, the bug appeared a few Slint versions ago. Maybe 1.14 or 1.15.

Runnable example: hulthe/slint-window-size-bug

Reproducible Code (if applicable)

import { AboutSlint } from "std-widgets.slint";

export component AppWindow inherits Window {
    width: 500px;
    height: 500px;
    Rectangle {
        width: 100%;
        height: 100%;
        background: green;
        AboutSlint {}        
    }
}

Environment Details

  • Slint Version: 1.16.0
  • Platform/OS: Linux (Wayland)
  • Programming Language: Rust
  • Backend/Renderer: winit/femtovg

Product Impact

We're looking into porting a desktop app to Slint. Our existing application design asks for a floating window with a specific size.

I'd call this bug an inconvenience rather than a blocker, since we can still use Window.preferred-width/height instead, but this property is not respected by tiling window manager, and our existing design is not adaptive enough to handle being maximized.

If there would be a way to tell the window manager that the window should be floating, that would be a preferable workaround.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions