Update to new winit 0.6 EventsLoop API#864
Conversation
Updates the winit dependency to 0.6 which introduces the new API.
c81f88e to
2581442
Compare
Use gl::Gl trait object in webrender The pull request is preparation of #771. It just replace gleam::gl function calls with function calls to gleam::gl::Gl trait object. API between winit and glutin is broken now. Then the pull request does not update glutin. The glutin still refers to old cgl and winit. It causes old gleam usage within them. Fixing the break is handled by rust-windowing/glutin#864. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/965) <!-- Reviewable:end -->
|
I looked into creating a I decided that it would probably be easier to setup windows and linux VMs and try to manually update their glutin APIs than it would be to create some kind of transition macro that would be removed shortly after anyway. @vberger, I briefly started transitioning the |
|
Hmm. Regarding Anyway, I'll try to give a got at updating the unix backend of glutin. However I'm mostly familiar with wayland, not x11, so I cannot promise anything, and this will probably need a detailed review. |
X11 & Wayland api update
Fix multiwindow example.
|
Ok, I think this might be just about ready to go! @vberger has updated the x11 and wayland backends and made a fix to the multiwindow example which got it working nicely again. I tested his changes on wayland in my VM and the examples seem to run fine. I just updated the windows backend using a VM to test compilation, however I couldn't run any of the examples due to the poor opengl support for win10 in my VM. There was not too much to change and I'm fairly sure it should behave the same, however it would be nice if someone could test this. I also had a go at updating the android backend as there seemed to be hardly anything to change. Again, I could not run this myself for testing, so it would be great if someone else could do so. I have not updated the @tomaka would you mind testing the windows build when you get a chance? Maybe also the android build if you have a setup available for doing so? If you don't have time, perhaps you could ping someone who might? |
Currently in the macOS backend the `Context` associated with each `Window` is never removed from the map once it is added until the `EventsLoop` is `Drop`ped. This commit refactors the backend to ensure each `Window`'s `Context` is removed from the map immediately upon either `Closed` or `Drop`.
|
I just realised that the context associated with each |
|
@vberger it seems like wayland-window 0.5.1 was published with some breaking changes. Travis is getting lots of errors that look like this: See travis' build log for more details. |
|
Okay, I'm not very troubled at how cargo handles dependencies. Why does it pull wayland-client 0.9, while winit and glutin require 0.8, and wayland-window allows both ? Anyway, I'll yank wayland-window 0.5.1 (and wayland-kbd 0.8.1 which probably has the same issue)... |
|
@vberger cargo always uses the most recent version allowed for each dependency, so although it does use the 0.8 version of
No worries! I think that the tooling around cargo could be greatly improved and more aware of the semantic versioning. E.g. if a user attempts to publish a new tiny version when the change is potentially breaking, it would be nice if cargo at least emitted a warning with a small note about how the change could break downstream crates. I think we'd avoid lots of accidental breakage like this. I kind of wish the semantic versioning was enforced even if conservatively, but that ship sailed long ago. @tomaka do you mind running the travis linux build again? |
EventsLoop APIEventsLoop API
|
@tomaka this is ready for review next time you get a chance 🙇 |
|
What is the status of this pull request? This update is very important to projects that are looking to utilize the latest version of |
|
Here's another weekly ping. |
This updates
glutin's API to reflectwinit's new API introduced in rust-windowing/winit#126, recently published under version 0.6.0. Please see the linked PR for further details on the new API.You can also see rust-windowing/winit#132 to find out how this new version of
winitsolves many old macos bugs.So far, this PR updates the API, macos backend and all of the examples to the new winit API. I haven't updated any of the other backends yet.
If I get time soon, I'll look into making a
gen_api_transition!macro similar to the one used in winit. If anyone else would like to tackle this in the mean time feel free to fork this PR and get it done!