-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
[wayland] hangs on poll_events and run_forever #884
Comments
This looks really like the issue already encountered with the various examples. TL;DR: you need to draw something on the window at least once before entering the event loop when using Long story: on wayland, the window do not appear until its contents have been defined at least once (as it's the contents that define the window characteristics such as the dimensions). As long as the window is not visible, it cannot receive any events from the user, and thus the event loop cannot make progress to reach the point where it draws something. Regarding |
@vberger seeing as this issue seems to pop up so regularly, perhaps it's worth seeing if there is some way that we can have the window automatically show for
Is it possible for us to do some sort of check within the Alternatively, rather than manually activating the glutin window like this, we could instead Either way, I think it would be nice if we could address this as the current behaviour is not consistent across platforms. |
Yes I agree this you, I'm just not sure what would the proper course be. A few months ago, while talking about this with @tomaka, he didn't seem thrilled by the idea of automatically drawing something without the user knowing... Certainly the easiest would be to just blitz a black content and call Otherwise, I'm not sure there is an easy way to check wether the window has been draw on at least once... ? |
@vberger come to think of it, perhaps we could do this when the
I personally would be more concerned that the windows behave differently across each platform. From what I remember macOS draws a gray window by default and I think Windows draws a blank window too (though I could be wrong, it's been a while!) so I think your suggestion is perfectly reasonable in terms of consistency, and at the very least would be less surprising than the current behaviour. @tomaka thoughts? If you give it the go ahead I could probably get around to implementing this at some point. |
Drawing at initialization would solve the problem for glutin, but not for winit though. |
The "initialization drawing" could be done in winit, by software-drawing a black frame and sending it to the wayland server. It would not add a lot of logic neither any dependency, as this is already what the wayland backend does to draw borders. And it would not impact the creation of an EGL/vulkan context afterwards. Would this be ok, @tomaka ? |
I guess so, yeah. |
I believe this has been addressed in rust-windowing/winit#188, rust-windowing/winit#190 and rust-windowing/winit#181 and can now be closed. |
Hi,
I have a problem with the new glutin 0.8 release. The following symptoms:
If you call
events_loop.run_forever
or 'poll_events' in your application on wayland, the window gets registered (I can see it in my gnome-panel) but the window doesn't appear. The application does NOT crash. It just stops. When debugging inside the application I can see that the application never ends theevents_loop.run_forever
/poll_events
.To find the deeper problem it was suggested to me that I should clone a local version of winit, use this a dependency and debug the
events_loop.run_forever
and theevents_loop.poll_events
function.I modified the functions with some
println!()
like this:run_forever
When using it with the window example of glutin, I get the following output:
As you can see problem occurs here of the original file (
self.ctxt.dispatch();
)The strange thing is, that it occurs after the third time repeating the loop. I tested it, its always the third one.
poll_events
When doing the same procedure for poll_events which looks like this: ...
... Glutin/winit gets stuck with this output:
So the problem is in this line of the original file.
Thanks in advance for having a look at it!
-Siebencorgie
The text was updated successfully, but these errors were encountered: