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

EventsLoop::interrupt does not interrupt a blocking call to dispatch during run_forever #189

Closed
mitchmindtree opened this issue May 24, 2017 · 4 comments

Comments

@mitchmindtree
Copy link
Contributor

Currently, the interrupt method only causes the loop to break when the next event is dispatched. The correct behaviour would be to cause the inner dispatch call to immediately stop blocking (it should not wait until the next event is received).

@vberger I'm unsure how to do this with wayland, any ideas? Perhaps there's a hint in the old WindowProxy code in pre-6.0.0 winit. It'd be nice if we could work this out before working on #187.

@mitchmindtree
Copy link
Contributor Author

It looks like the old wayland WindowProxy code used to call this WlDisplay method via the WaylandContext. After trying it out, this alone does not seem cause a break from dispatch. The docs do however mention that it causes a done event to be emitted. Perhaps this means we have to implement this trait for InputHandler and use it to break from the loop if interrupt was called?

@elinorbgr
Copy link
Contributor

You'd also need to make a call to WaylandContext::flush() so that the sync event is effectively sent to the server. Whithout that, we would never receive the "done" event to would unlock the blocking call.

@mitchmindtree
Copy link
Contributor Author

@vberger ahh thanks for the tip, I've got this working in #191.

@jwilm
Copy link
Contributor

jwilm commented Jun 23, 2017

Can this be closed now that #191 landed?

tmfink pushed a commit to tmfink/winit that referenced this issue Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants