Open ickk opened 2 months ago
I skimmed the source, and I think this might be because of the way winit tries to get RedrawWindow
/WM_PAINT
to throttle redraws?
Yes, redraws are throttled by the compositor usually, though, WM_PAINT
looks so broken that winit should likely use something else.
I'm getting the same problem. I would have assumed that redraw events are only throttled per window? Is there any work around to this or does it require a patch to winit?
I mean if you want to draw when your window is not visible and compositor thinks that you shouldn't, then just draw unconditionally after timeout or so. In general if you don't get the event back it means that you shouldn't draw at all, because the window is either obscured or something like that, so user wont ever see anything anyway.
Is there any work around to this
I think what might mostly work is to send request_redraw
for only your main window, and then draw to all windows when you receive it
But why would you want to do that though? If you want to draw when you're suggested to not do so then just draw unconditionally?
I don't believe the premise is that RedrawRequested
is not sent because windows are obscured, the premise is that its a bug. In which case OP was just looking for a workaround.
@ickk it would be good to know if you are indeed not getting RedrawRequested
events because wundows are obscured. Can you confirm that all windows are visible?
it would be good to know if you are indeed not getting
RedrawRequested
events because wundows are obscured. Can you confirm that all windows are visible?
I can confirm the minimal reproduction included in the issue body produces the same result even when all windows are fully visible
Description
When I create multiple windows with winit, and for each window call
window.request_redraw()
in theAboutToWait
handler, I do not receive the correspondingWindowEvent::RedrawRequested
for all of the windows that requested.minimal reproduction:
output observed:
that is, I only receive the
RedrawRequested
event for the last 2 windows.If I also call
request_redraw()
inside theRedrawRequested
handler for the given window, as follows:then I observe the following:
that is, I receive two consecutive
RedrawRequested
events (sometimes just 1), but only ever for the last window.Neither approach behaves as I would expect. I would expect to reliably receive a single
RedrawRequested
event for each windowWindows version
Winit version
v0.29.15