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

Wayland's eventloop 2.0 #790

Merged
merged 5 commits into from
Feb 21, 2019
Merged

Conversation

elinorbgr
Copy link
Contributor

This is the port of the wayland backend to events loop 2.0.

Notably:

  • the X11-specific code in platform_impl / platform has been commented-out
  • it also updates the wayland dependencies:
    • wayland-client to 0.22
    • SCTK to 0.5

@elinorbgr
Copy link
Contributor Author

No sure who'd be best to review this ? It's honestly a pretty boring diff, as the port to the new eventloop setup didn't require any deep refactor of the wayland code.

Most of the diff is:

  • the changes in wayland/event_loop.rs, which are needed to match the new API, this includes the use of calloop to drive the events loop
  • a lot of search&replace to match the new types of wayand-client 0.22
  • the resolution of what I believe to be forgotten merge conflicts in Event Loop 2.0 API and Windows implementation #638

@Osspial
Copy link
Contributor

Osspial commented Feb 11, 2019

I read over the diff, and nothing in particular stood out to me as erroneous in your code (for what that's worth, as someone without much knowledge of the Linux backend).

However, there was one thing I noticed in the public cross-platform API that seems a bit misleading, but not technically unsafe - the T in EventLoopProxy<T> isn't marked as 'static. It's impossible to create an EventLoopProxy where T isn't 'static, but I must have looked over adding the trait bound when I created it so we should probably add that in.

@elinorbgr
Copy link
Contributor Author

elinorbgr commented Feb 14, 2019

Do you want it added to this PR, or can we merge it and do it in a second time?

@Osspial
Copy link
Contributor

Osspial commented Feb 15, 2019

Could you change the API here and add in the bounds on Linux? I'll push another commit that gets it working on Windows after this has been merged to this branch before we merge this.

@elinorbgr
Copy link
Contributor Author

Alright, will do that

@elinorbgr
Copy link
Contributor Author

This should do it, I also added the bounds in the windows code, it seemed simple enough.

@Osspial
Copy link
Contributor

Osspial commented Feb 15, 2019

It looks like one of the tests was broken, but that should be fixed now. Once the CI finishes this should be ready to merge.

@Osspial
Copy link
Contributor

Osspial commented Feb 16, 2019

Actually, I went ahead and tested this on my Linux machine and a couple of points came up:

  • I pulled in some of the work from Add wayland specific code to examples for windows to appear #780 to my own branch to do tests, but even with that code a window didn't appear. I needed to make some modifications to the helper script to get it working so this may be an issue on my end, but you should check the code here to make sure this isn't an issue with the backend.
  • There's some special-casing of the RedrawRequested event that I'm not sure is being handled - in some cases, it can be sent after EventsCleared but before NewEvents (see here). Is that behavior implemented? I didn't notice it, but I could also just be blind.

@elinorbgr
Copy link
Contributor Author

I added the proper code to handle RedrawRequested special cases.

However I'm not clear on what you did actually change to make the window appear? I does display a window with transparent contents for me.

@elinorbgr
Copy link
Contributor Author

This should be good now, are you ok with that @Osspial ?

@Osspial
Copy link
Contributor

Osspial commented Feb 20, 2019

@vberger 👍

@elinorbgr
Copy link
Contributor Author

Alright, so I'll merge this into the eventloop-2.0 branch, so that the x11 work can be done on top of it.

@elinorbgr elinorbgr merged commit 6513351 into rust-windowing:eventloop-2.0 Feb 21, 2019
felixrabe pushed a commit to felixrabe/winit that referenced this pull request Jun 30, 2019
* match unix common API to evl 2.0

* wayland: eventloop2.0

* make EventLoopProxy require T: 'static

* Fix linux build and tests

* wayland: update sctk & small fixes
kosyak pushed a commit to kosyak/winit that referenced this pull request Jul 10, 2019
* match unix common API to evl 2.0

* wayland: eventloop2.0

* make EventLoopProxy require T: 'static

* Fix linux build and tests

* wayland: update sctk & small fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants