Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upNative wayland support via glutin #9558
Comments
|
@zmike, how did you work around all of this in your Servo-on-Wayland work? |
|
My understanding is that platform_display is used for parenting windows in X. I assume it's deprecated in glutin by the plans for rust-windowing/glutin#702. |
|
Actually it looks like it's more complicated than that; sorry. There are more uses of |
|
I didn't use glutin, I used the embedding API with my demo application that has Wayland support. iirc cc @pcwalton and @glennw for |
|
Alright thanks, i'll look on that side regarding GL contexts and such. If it's also used for parenting X windows (if I understand correctly what it implies, aka subsurfaces in wayland), it's a hint that maybe glutin's api is too narrow for what servo needs to do. As such, it might be interesting to explicit what the real need is behind that, to maybe work on integrating a minimal platform-unified way to do that in glutin (or, soon to be, winit) ? |
|
@vberger Thanks for looking into this! I suspect that the easiest way to get Servo working on wayland now will be to use webrender - when using webrender, all drawing is done via GL calls only - there shouldn't be any calls made to native_display(), and we shouldn't use any X11 / GLX specific functionality (if you do hit these code paths when running with WR that's a bug, as those are used for texture sharing in rust-layers). Webrender currently relies on having either a GL3.3 or GLES3 context available, and apart from that should have no additional requirements. Is it currently possible to set up once of those context types from the wayland backend? |
|
Okay, I'll look in the webrender direction then. GL3.3 should be provided by glutin over wayland, assuming the mesa driver of the computer its run on provides it. However, I don't know when exactly I'll be able to dig more into it, I've quite a lot going on currently. |
|
any progress on that @vberger ? |
|
I'm currently mostly busy with a large re-design of my wayland libs, so I didn't progress on that, and have still a lot to do before I could. Also, I kinda heard that servo more or less planned to stop using glutin, so I didn't really keep an high focus on that. |
|
I'm pretty sure the rumours of glutin's demise in Servo have been exaggerated. I'm not aware of any effort to replace it at this point in time. |
|
Okay. My timeline for now is anyway: first finish my redesign and publish wayland-client 0.7, then integrate it into glutin/winit, and then I'll work from that. |
|
@jdm is correct. There's no plan to stop using glutin, and even if we had one, I suspect we'd use a custom fork. I'm not aware of any real alternatives. |
For the record, the function itself has been deprecated but a replacement has been added in a trait named |
|
I don't know if this has been fixed but I'm able to run servo on wayland+gnome now. |
|
@zbraniecki: I think this isn't fixed, Servo should run on top of XWayland right now. |
|
Just to give some news, most (all ?) of the required work in glutin is now done, and I'm getting back at this. However, I'll need to wait for glutin-servo to catch up to glutin-0.7 (all non-opengl stuff was moved to the winit crate, so I believe half or more of the servo-specific patches of glutin will need to be moved to a winit-servo crate, or upstreamed ?) |
|
Any change on the status of Servo on Wayland? |
|
No. We're in the process of switching to the upstream glutin, however: #19895 |
|
When I run servo on Gnome 3 + Wayland on current Arch, this is the result: https://imgur.com/a/tZjDt When I run it on Gnome3 + X11 it works. |
|
What is the status of this issue now? Servo is now using upstream glutin along with the latest wayland-* crates. |
|
It should "just work". As in, nothing special to do on Servo's side. But I'm afraid we'll run into sizes and resolution issues on any hidpi devices. See rust-windowing/winit#305 |
|
I just tried on sway, and I can confirm it "just works" except for dpi. Servo does not seem to follow the HiDPI information suggested by winit. On my computer with a screen with dpi factor of 2.0, only the bottom-left quarter of the window contains the displayed web page, the 3 other quarters are just a white background. |
|
If this works, then should the issue be closed and more specific issues be filed for any little bugs discovered later? |
|
It's definitely possible to run servo in wayland environments. |
Hi, I'm the maintainer of the wayland-client crate and its friends, as well as the wayland backend of glutin.
As a way to stress-test and improve my implementations, I was thinking of tring to make servo run with them, and as planned, it did not work out of the box.
The first reason for this is the use by servo of glutin's
Window::platform_display()(which currently hits anunimplemened!()of the wayland backend), hereservo/ports/glutin/window.rs
Line 642 in 525e77f
(And writing this, I discover that this function is marked as deprecated in glutin's documentation.)
Well, my question is: what does servo use this
platform_displayfor? I guess the wayland equivalent is probably the main display, but I'd like to understand what's going on before trying some unsafe magic.Or maybe, given the deprecation notice in glutin, something would need to be done on servo's side?