Conversation
|
Anyone want to try this / make fixes for Mac / Windows / Android? I think they should be relatively minor. |
|
@glennw I'll compile & test on Android. We'll need to wait for this PR to be merged: rust-windowing/glutin#868. The glutin API have changed, so I need to resubmit the PR, and we´ll need to update the glutin version here when published |
|
For mac: diff --git a/ports/glutin/window.rs b/ports/glutin/window.rs
index e4247c6523..b26a4b769b 100644
--- a/ports/glutin/window.rs
+++ b/ports/glutin/window.rs
@@ -86,7 +86,7 @@ fn builder_with_platform_options(mut builder: glutin::WindowBuilder) -> glutin::
// output file.
builder = builder.with_activation_policy(ActivationPolicy::Prohibited)
}
- builder.with_app_name(String::from("Servo"))
+ builder.with_title(String::from("Servo"))
}
#[cfg(not(target_os = "macos"))]When resizing, the window only displays white until I let go of the mouse button. |
|
☔ The latest upstream changes (presumably #17184) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Platform specific |
|
I want to try helping with this on Windows and am going to see if I can get it to compile here shortly. Can we get a rebase? One of the other things that just got fixed for Windows is the ability to run the WPT suite. It would be useful if this was applied on top of that, I think, in the sense that I'm going to have to somehow have those commits involved |
|
A simple |
This builds and runs correctly on Linux with upstream glutin. Moving to upstream glutin would have a few advantages: * Get future updates easily. * Allow us to upstream some planned optimization work on glutin (primarily swap buffers and dirty rect support). * Easily work with D3D / Wayland / Vulkan backends. There's a number of items that would need to be checked / fixed before we could land this: - [ ] Get compiling and test on Mac. - [ ] Get compiling and test on Windows. - [ ] Get compiling and test on Android. - [ ] Confirm that window resizing and painting is working correctly on Mac. - [ ] Get the icon loading patches either upstreamed or rebased on a new glutin fork. - [ ] Get the platform_window() code working [or drop CEF for now?].
|
I have pushed my rebased and amended version of this branch to https://github.com/jdm/servo/tree/unfork-glutin . |
|
It currently fails |
|
@jdm Is rebasing mine and opening a PR against them, whereupon they rebase theirs (presumably to a later point off master than mine) and then I rebase mine on theirs again going to work? This sort of workflow doesn't seem to be documented by anyone. I thought I was fairly good with git until today. |
|
I know; but providing a branch makes it extremely easy for @glennw to reset this PR's branch to an already working rebased copy. |
|
Rebased commit has been pushed. |
|
☔ The latest upstream changes (presumably #17561) made this pull request unmergeable. Please resolve the merge conflicts. |
|
I will take another more serious look at this hopefully this weekend. |
| } | ||
| Event::KeyboardInput(element_state, _scan_code, Some(virtual_key_code)) => { | ||
| self.handle_keyboard_input(element_state, _scan_code, virtual_key_code); | ||
| Event::WindowEvent { event: glutin::WindowEvent::KeyboardInput(state, scan_code, Some(virtual_key_code), _), .. } => { |
There was a problem hiding this comment.
Shouldn't we use the new mods parameter and not rely on key_modifiers?
| } | ||
| } | ||
| let mouse_pos = self.mouse_pos.get(); | ||
| self.handle_mouse(mouse_button, element_state, mouse_pos.x, mouse_pos.y); |
There was a problem hiding this comment.
We need pos. mouse_pos is updated on mouse move. But it's possible that the click happened without a prior mouse move event. For example, if the mouse changes position when servo was not focused.
| self.mouse_pos.set(Point2D::new(x, y)); | ||
| self.event_queue.borrow_mut().push( | ||
| WindowEvent::MouseWindowMoveEventClass(TypedPoint2D::new(x as f32, y as f32))); | ||
| }; |
There was a problem hiding this comment.
Same comment as for click. pos is necessary.
|
Glutin has changed the API again. There is not a clear way to rebase the Android PR: rust-windowing/glutin#868 Asked tomaka about the issue. Will change the code & rebase again when we I get his feedback. |
|
Any update here? It'd be quite nice to get this landed eventually. |
|
Ping on this. |
|
FYI, I built a Servo port (with tab support) that uses the upstream glutin: https://github.com/paulrouget/servoshell - (see the |
|
I'm not going to have time to work on this in the near future - closing for now. |
This builds and runs correctly on Linux with upstream glutin.
Moving to upstream glutin would have a few advantages:
There's a number of items that would need to be checked / fixed before we could land this:
This change is