Skip to content
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

servoshell: draft to show a status bar tooltip #31751

Closed
wants to merge 3 commits into from

Conversation

sandeepB3
Copy link
Contributor

As far as I understand, three files come into play here: webview.rs, app.rs, and minibrowser.rs.

In webview.rs, the handle_servo_events function manages the Embedder message status and returns a ServoEventResponse struct updated with the status to the caller (app.rs).

The app.rs is the main file which manages the event loop and the windowing system of the minibrowser. Here, we add a new status variant to the PumpResult enum. Once app.rs calls the handle_servo_events function, it receives the new ServoEventResponse containing the status. The status variant can then be updated in the respective places where the PumpResult enum is being used.

Finally, if the status matches the Some variant, app.rs can pass this status to the update function inside webview.rs (now updated with an additional parameter status: Option<String>) to show the egui tooltip if there is some status.


Sandeep Pillai added 3 commits March 19, 2024 13:31
Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>
Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>
@delan
Copy link
Sponsor Member

delan commented May 1, 2024

Thanks for working on this! Sorry for the delay in reviewing it, I saw this was a draft so I assumed it wasn’t ready.

Unfortunately the status bar tooltip won’t really be visible with the current approach, because the Minibrowser will run a single egui update with the new tooltip, then immediately go back to having no tooltip in subsequent updates.

Plumbing the status through PumpResult::Continue and Minibrowser::update like this also complicates checking whether we need to run an egui update, so we end up with bugs like running two updates when history_changed and status is Some, or not running any updates when status goes from Some to None.

Since #32011 is more complete, and takes advantage of the new update logic introduced in #31713, I’m going to close this for now, but thanks again for your effort.

@delan delan closed this May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

servoshell: show a status bar tooltip when hovering over links
2 participants