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
winit: initial minibrowser #29976
winit: initial minibrowser #29976
Conversation
Minibrowser: Introduce minibrowser.enabled prefs Introducing minibrowser.enabled prefs in preparation of #29976 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Minibrowser: Introduce minibrowser.enabled prefs Introducing minibrowser.enabled prefs in preparation of #29976 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync. |
🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync. |
🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync. |
🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync. |
🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync. |
was egui_glow ^0.22.0 (0.22.0) → egui/bytemuck ^0.22.0 (0.22.0) → epaint/bytemuck ^0.22.0 (0.22.0) → bytemuck ^1.7.2 (1.13.1) → bytemuck_derive ^1.4 (1.4.1) → syn ^2.0.1 (2.0.28) now lock has bytemuck_derive 1.4.0 → syn ^1.0.99 (1.0.103)
(we don’t need support for hyperlinks in our use of egui)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for walking through this with us. I'm excited about this functionality! I just have a few suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for these updates. This looks great!
This patch introduces a new minibrowser mode, enabled by running the winit port with --minibrowser.
The minibrowser has a location bar and a go button. The location bar updates to reflect the URL of the top-level browsing context, unless the user has started editing the location without clicking go.
It has been tested on Linux with X11, but should also work with Wayland and on Windows and macOS.
Some changes to the compositor were necessary to allow Servo and our minibrowser code to cooperatively draw to the same OpenGL framebuffer. Normally the compositor “presents” each new frame (swapping buffers) as soon as WebRender has drawn to it, but we need to make sure that both WebRender and the minibrowser are repainted on every frame. Failing to do so leads to strange glitches where new frames get overwritten with stale framebuffer contents.
We add an external_present mode that instead notifies the embedder (via the constellation) that a new frame is ready, allowing the embedder to draw other things to the framebuffer. In external_present mode, the compositor does not run again until the embedder calls present, to ensure consistency of WebRender output, and IOCompositor::clear_background no longer clears the whole framebuffer, only the viewport area.
Some optimisations were also necessary to make this performant:
./mach build -d
does not report any errors./mach test-tidy
does not report any errors