Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Slow start and white window #2254

Open
ogoffart opened this issue Feb 17, 2023 · 4 comments
Open

Windows: Slow start and white window #2254

ogoffart opened this issue Feb 17, 2023 · 4 comments
Assignees
Labels
a:platform-windows Issue specific to Windows (mT,bS) bug Something isn't working priority:low Lowest priority. The issue is kept open for tracking purpose, but noone is actively working on this

Comments

@ogoffart
Copy link
Member

Following a discussion on mattermost, it was reported that on window, the window first appear white, and then it takes a long time until the first frame appear

@ogoffart ogoffart added this to the 1.0.0 milestone Feb 17, 2023
@ogoffart ogoffart added a:platform-windows Issue specific to Windows (mT,bS) a:backend-winit Winit backend (mS,mO) labels Feb 17, 2023
@ogoffart
Copy link
Member Author

I can reproduce the problem, this is with the winit backend. The Qt backend works as expected.

The window is shown before the event loop is started. It appear that GLWindow::show takes some time to run, then the event loop starts.
We were told that other framework using winit workaround the glitch by keeping the window hidden until the init phase is done iced-rs/iced#1698

@tronical tronical self-assigned this Mar 20, 2023
@tronical
Copy link
Member

I can sort of reproduce this. I've made clips of this with the different renderers. This is a release build:

Qt:

Qt.mov

Softbuffer:

Softbuffer.mov

Skia (D3D):

Skia.mov

Skia (Glutin):

Skia.Glutin.mov

Glutin/FemtoVG:

Glutin.mov

@tronical
Copy link
Member

The above clips suggest to me that this is more related to the way OpenGL rendering happens on Windows (and for example the driver situation), that it is about winit.

@tronical tronical removed this from the 1.0.0 milestone Mar 24, 2023
@tronical
Copy link
Member

It might be possible to change the startup sequence in the winit backend from

let window_builder = ...
let window = window_builder.build();
...

fn paint_event()
{
    render_into_window(window);
}

to

let window_builder = ...
let window_builder = window_builder.with_visible(false);
let window = window_builder.build();
render_into_window(window); // calls swapBuffers
window.set_visible(true);
...

fn paint_event()
{
    render_into_window(window);
}

@ogoffart ogoffart added bug Something isn't working priority:low Lowest priority. The issue is kept open for tracking purpose, but noone is actively working on this and removed a:backend-winit Winit backend (mS,mO) labels Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:platform-windows Issue specific to Windows (mT,bS) bug Something isn't working priority:low Lowest priority. The issue is kept open for tracking purpose, but noone is actively working on this
Projects
None yet
Development

No branches or pull requests

2 participants