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
Ported glutin to winit #819
Conversation
Wayland is still broken (tested with sway):
Have not touched ios and emscripten backends. win, linux/x11, osx, android backends work but I haven't tested them extensively. |
r? :) |
The wayland error is expected, it appears that sway is a little behind in its versions of the core wayland protocol. It'd be good to relax this restriction, but this is a 100% winit issue anyway, so not relevant for this PR. |
Other than that, LGTM for the wayland part (expect for the |
As an afterthought, I don't know how it is on other platforms, but on a resized event, for wayland, the EGL won't be automatically resized, and that's it which defines the actual size of the window. This is the reason for this particular line in the previous backend : https://github.com/tomaka/glutin/blob/d87fa4f6b749f67eb37300cb9dc58cf31c3ff5b5/src/api/wayland/window.rs#L79 No sure how it should be implemented now, though. EDIT: likewise, set_inner_size() method in Window should resize the EGL surface as well |
Some initial review:
There's no justified reason anymore to have I think it looks mostly good. Other than making it possible to use winit with gfx, it will also considerably clean up glutin. I'll review again once these three things are resolved. |
@tomaka Done |
Looks good. There are some things that could be improved now that the organization has changed, but it's ok for now. r? @vberger for the wayland stuff? |
I have no working wayland test zone so wayland's resizing stuff is still not fixed :( |
My idea was that now that |
Ok, I'll ask @Vinatorul if he can look into it |
@ozkriff sure, I'll check tomorrow |
The idea would be to make a light wrapper around the Also, |
I've done this, please check WIP_wayland_port_glutin_to_winit, but I can't test it. |
I tried running it yesterday on weston, and the |
Oh wait, nvm, I hadn't checked out the proper branch |
(I'll test it this evening, my current computer is not wayland-egl compatible) However @Vinatorul : winit should only fallback to X11 if creation of a wayland context failed, so this might be a bug with |
@vberger I've run Globals advertized by server:
1 : wl_drm (version 2)
2 : wl_compositor (version 3)
3 : wl_shm (version 1)
4 : wl_output (version 2)
5 : wl_data_device_manager (version 2)
6 : xdg_shell (version 1)
7 : wl_shell (version 1)
8 : gtk_shell (version 2)
9 : wl_subcompositor (version 1)
10 : _wl_pointer_gestures (version 1)
11 : wl_seat (version 4) |
Well, I've tested your code on weston, seems to work. There are just two things:
|
Other than that, looks good 😄 |
The border size issue was indeed from winit, see rust-windowing/winit#30 |
@vberger Hmm, I'm not sure this should be done in this PR |
That's probably out of scope for this PR indeed, as it was already the previous behaviour. It's just that I re-discovered it while testing your code. |
So, are we ready for merging? :) |
|
@Jascha-N No, probably a mistake. |
For #813
Requires rust-windowing/winit#23