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

Make wayland_server::create_event_loop public #167

Closed
wants to merge 1 commit into from

Conversation

valpackett
Copy link
Contributor

@coveralls
Copy link

coveralls commented Apr 15, 2018

Coverage Status

Coverage remained the same at 0.0% when pulling 23d00fd on myfreeweb:expose-api into 8e6b642 on Smithay:master.

@elinorbgr
Copy link
Member

Most of the safety of the EventLoop wrapper relies on the fact that it has exclusive control over the *mut wl_event_loop associated with it (which is typically ensured by it being created at the same time as the Display). For this reason, I'm going to be rather reluctant to merge this as is unless there is a really good reason to do so.

So, if I understand correctly you are working on libweston bindings. I don't know how much control over the event loop libweston requires, but I guess it's not liberal enough that you can just create the display with the wayland-server crate and provide it to it?

@valpackett
Copy link
Contributor Author

hm, I'm actually creating the display myself. I'm not sure why I have my own wl_display wrapper... oh, probably because I want to create new Display references from a raw *mut wl_display.

@valpackett valpackett closed this Apr 15, 2018
@valpackett
Copy link
Contributor Author

Oh. Actually. I still need this. I have the Rust side implementing an API that Weston calls into.

But maybe for EventLoopHandle instead of EventLoop

@valpackett valpackett reopened this Apr 15, 2018
@elinorbgr
Copy link
Member

If you need it only for EventLoopHandle (registering & implementing new resources, I guess ?), then it is possible that the incoming 0.20 rework (see #165 ) will solve your issue, as it largely decouples resources and implementing them from the EventLoop type, and EventLoopHandle is completely removed. This PR is almost ready, and I'm just checking the few potentials missing bits by working on Smithay/smithay#88 using it.

Overall, this reworks does break a lot of things, but should make many things easier to integrate and handle I believe. Maybe if you summarize the precise uses you need EventLoop and EventLoopHandle for, I can see if some adaptations to wayland-rs 0.20 should be done accordingly?

@valpackett
Copy link
Contributor Author

registering & implementing new resources, I guess

No. I just need to call add_fd_event_source in a Rust impl that's called from C (libweston).

I just realized though, I can actually use user_data on libweston's compositor object to pass the Rust event loop object through the C world!...

@valpackett
Copy link
Contributor Author

Done.

I guess I was also slightly confused by the lack of a run method on your Display, but running the EventLoop works fine.

@valpackett valpackett closed this Apr 15, 2018
@valpackett valpackett deleted the expose-api branch April 15, 2018 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants