iced-rs / iced

A cross-platform GUI library for Rust, inspired by Elm
https://iced.rs
MIT License
22.96k stars 1.06k forks source link

Layout issues when resizing window #2391

Closed njust closed 1 week ago

njust commented 1 month ago

Is there an existing issue for this?

Is this issue related to iced?

What happened?

Using the current master branch, a simple layout causes problems when resizing the window:

https://github.com/iced-rs/iced/assets/2380253/87041735-396e-46ed-a96e-2595e6e4ae55

Repository with the example: https://github.com/njust/iced_layout_issue

What is the expected behavior?

The layout should be consistent.

Version

master

Operating System

Windows

Do you have any log output?

No response

hecrj commented 1 month ago

I cannot reproduce.

njust commented 4 weeks ago

I'm working on a virtual machine (VMWare Workstation 17). I recognized that iced version 0.12.1 has the same layout issues, but only when using the wgpu backend. Switching to the tiny-skia backend solves that on version 0.12.1. Unfortunately, using the tiny-skia backend on the current master branch, doesn't fix the layout issues. From the log I can see that the following adapter was selected:

INFO [iced_wgpu::window::compositor] Selected: AdapterInfo {
    name: "Microsoft Basic Render Driver",
    vendor: 5140,
    device: 140,
    device_type: Cpu,
    driver: "",
    driver_info: "",
    backend: Dx12,
}

I also attached the full log. Hope that helps. Demo_2024-04-18_09-33-17.log

njust commented 4 weeks ago

Sorry for the double post. But it seems, that setting the environment variable ICED_BACKEND=tiny-skia doesn't have an effect on the current master branch. Therefore, I tried to force the usage of tina-skia by removing the wgpu feature via default-features = false which leads to a white screen: image

njust commented 2 weeks ago

Short update, I tried today again with the latest master branch and this is still an issue. I updated the example to use the content explain feature. The problem only occurs if the content in the scroll area does not have enough space:

https://github.com/iced-rs/iced/assets/2380253/03cfbf9a-2f0b-4f77-8858-cd6ced53d1c1

I also attached the current log file: Demo_2024-05-03_17-55-50.log

The repository with the updated example is here: https://github.com/njust/iced_layout_issue

Is there any way I can help to analyze the problem?

hecrj commented 1 week ago

This is most certainly a graphics driver issue.

If you are using a VM, enable the tiny-skia feature and use it with ICED_BACKEND=tiny-skia.