slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.71k stars 614 forks source link

UI sometimes looks invalid when adjusting size #5681

Open showier-drastic opened 4 months ago

showier-drastic commented 4 months ago

Platform: macOS ARM + latest Rust

Reproduction code: https://github.com/showier-drastic/slint-rust-bug-demo

I have written code to do a simple layout, where the font size of numbers are adjusted with window size, and the rest of the window is filled with blue color. The code is pretty simple:

image

Now the bug is, when you drag the corner to adjust the window size and release the mouse, there's some chance that the window will display something crippled, like shown in the video:

https://github.com/user-attachments/assets/b5bd65ee-928c-4a0d-a17b-67c398e24696

Note that this happens probabilistically (most time it works), but it typically will happen within 1 minute of playing.

tronical commented 4 months ago

Thanks for the graphical report :). I'm curious, could you try enabling the renderer-skia feature and see if that changes the output for you? (that'd use a meta CA layer, instead of nsopenglcontext)

showier-drastic commented 4 months ago

No, does not happen with skia.

tronical commented 4 months ago

Thanks for confirming. I suggest that as a workaround for now.