floem icon indicating copy to clipboard operation
floem copied to clipboard

Examples do not paint the UIs on startup.

Open phillipbaird opened this issue 2 years ago • 3 comments

Have just discovered Floem (via This Week in Rust) and have been looking at the examples.

Problem: None of the examples paint their UIs upon startup (at least on my system). The winit window frame is displayed but the window content is just whatever was on screen behind the window when it opened. The only action that triggers the UI to start painting itself is resizing the window. Via the Counter example I can observe that I can click on the buttons that are not visible (the console reports when the counter is reset). These application state changes do not trigger the UI to paint itself. Once the window has been resized to trigger the first paint of the UI the examples work as intended.

Environment rustc: 1.73.0 - stable-x86_64-unknown-linux-gnu Operating System: Arch Linux KDE Plasma Version: 5.27.9 Kernel Version: 6.6.1-arch1-1 (64-bit) Graphics Platform: X11 Graphics Processor: NVIDIA GeForce GTX 1080

Please let know what else I can do to assist solving this problem.

Thanks.

phillipbaird avatar Nov 11 '23 00:11 phillipbaird

Awesome to hear! (about This Week in Rust that is).

I'm not experiencing this issue and since I'm on macOS I don't have any great way to debug it directly. There may have been some recent changes that would affect painting the first frame. Could you try checking out this commit from about a month ago 5dd6c86843a6786f80e1f5fc542b94a02b04e8f9 and see if the issue is still there? If it's working in that commit could you run a git bisect to find the commit where it broke?

jrmoulton avatar Nov 11 '23 01:11 jrmoulton

It looks like the bump to winit on 25th October is where the problem starts.

cf4c09e - is the last commit that works for me d7a9356 - bumps winit - does not compile 6fbaf7e - compiles and where I can observe the problem for the first time.

Hope that helps.

phillipbaird avatar Nov 11 '23 03:11 phillipbaird

Have discovered the problem can be worked around by supplying a WindowConfig with a custom window size.

fn main() {
    let window_config = WindowConfig::default().size(Size {
        width: 1920.0,
        height: 1080.0,
    });
    floem::Application::new()
        .window(move |_| app_view(), Some(window_config))
        .run();
}

phillipbaird avatar Nov 11 '23 09:11 phillipbaird