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

Edge Browser: Replace BrowserInformationControl dosn't work on hover #1540

Open
amartya4256 opened this issue Oct 15, 2024 · 9 comments · May be fixed by #1545
Open

Edge Browser: Replace BrowserInformationControl dosn't work on hover #1540

amartya4256 opened this issue Oct 15, 2024 · 9 comments · May be fixed by #1545
Labels
edge Edge Browser

Comments

@amartya4256
Copy link
Contributor

amartya4256 commented Oct 15, 2024

Describe the bug
When using Edge Browser as the default browser, the BrowserInformationControl for the JavaDoc hover tooltip doesn't replace with navihation buttons on hovering.

To Reproduce

  • Use Edge browser as the default browser.
  • Hover over a piece of code to open a javadoc tooltip.
  • Hover over the tooltip.
  • The navigation buttons won't appear and it wont be possible to navigate if you click on a link.
  • The BrowserInformationControl is only replace if you hover to the bottom of the tooltip where the ends in the bottom. It is triggered by the styledText in the bottom and not the browser.

Expected behavior
The BrowserInformationControl should be replaced with the ones with navigation buttons with any action on the tooltip.

Note: With WebView2, it doesn't seem possible to capture hover events and one possible proposal could be to trigger this event on Mouse Click and other Mouse Events which can be captured.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment:

  1. Select the platform(s) on which the behavior is seen:
    • All OS
    • Windows
    • Linux
    • macOS
  1. Additional OS info (e.g. OS version, Linux Desktop, etc)

  2. JRE/JDK version

Version since
Eclipse or SWT version since when the behavior is seen [e.g. 4.23]

Workaround (or) Additional context
Add any other context about the problem here.
Any known workarounds for the problem?

@amartya4256 amartya4256 changed the title Edge Browser: Replace BrwoserInformationControl dosn't work on hover Edge Browser: Replace BrowserInformationControl dosn't work on hover Oct 15, 2024
@fedejeanne
Copy link
Contributor

I added this issue to the roadmap.

@amartya4256 please provide a screenshot to better understand the issue.

@sratz sratz added the edge Edge Browser label Oct 15, 2024
amartya4256 added a commit to amartya4256/eclipse.platform.ui that referenced this issue Oct 16, 2024
With this commit, the hover information control can be replaced on the
focus in event.

contributes to eclipse-platform/eclipse.platform.swt#1540
amartya4256 added a commit to amartya4256/eclipse.platform.ui that referenced this issue Oct 16, 2024
With this commit, the hover information control can be replaced on the
focus in event.

contributes to eclipse-platform/eclipse.platform.swt#1540
amartya4256 added a commit to amartya4256/eclipse.platform.ui that referenced this issue Oct 16, 2024
With this commit, the hover information control can be replaced on the
focus in event.

contributes to eclipse-platform/eclipse.platform.swt#1540
amartya4256 added a commit to amartya4256/eclipse.platform.ui that referenced this issue Oct 16, 2024
With this commit, the hover information control can be replaced on the
focus in event.

contributes to eclipse-platform/eclipse.platform.swt#1540
@sratz
Copy link
Member

sratz commented Oct 16, 2024

I looked into mouse events in general.

WebView2 does not offer any native API for this.

However, it should be possible to use a BrowserFunction or a host object + some mouse event listeners on the DOM to react on those.

I got a PoC partially(*) working locally which I need to clean up and will submit a draft PR when I find some time.

@HeikoKlare
Copy link
Contributor

However, it should be possible to use a BrowserFunction or a host object + some mouse event listeners on the DOM to react on those.

I got a PoC partially(*) working locally which I need to clean up and will submit a draft PR when I find some time.

That sounds great! So if I understand correctly, that would render #1499 with eclipse-platform/eclipse.platform.ui#2408 obsolete, as it will allow to restore the "original" hovering behavior, won't it? Do think we should thus hold those back those PRs and wait for your draft PR, @sratz?

@merks
Copy link
Contributor

merks commented Oct 17, 2024

Just a random thought: I also wondered if org.eclipse.swt.widgets.Display.addFilter(int, Listener) might help see events one might not otherwise see...

@HeikoKlare
Copy link
Contributor

Just a random thought: I also wondered if org.eclipse.swt.widgets.Display.addFilter(int, Listener) might help see events one might not otherwise see...

As far as I understood the analysis results, once the cursor is on top of the (embedded) WebView component, no mouse events will reach the Eclipse/SWT process (and thus the Display class) anymore. They are already processed by the WebView process. That why this PR proposes, as a first step, to notify about focus events (implicitly triggered by clicking into the WebView component) and Sebastian's proposal would capture the mouse events within the WebView process and explicitly pass them to the Eclipse/SWT process via callback.

@merks
Copy link
Contributor

merks commented Oct 17, 2024

Yes, if the embedded view can do the proper work, that would ideal and better. I just randomly wondered if say via a timer event one could trigger determining the location of the mouse position to know it is over the area of the display in which the browser component exists and could determine when hovering is occurring because the mouse point remains in that area without moving. Anyway, it's just a random thought...

@HeikoKlare
Copy link
Contributor

Yes, interesting idea/"tweak" 👍 We discussed similar approaches but I am not sure whether we had that exact one on the list. @amartya4256 do you remember if you already tried something like that or if that may be feasible?

@amartya4256
Copy link
Contributor Author

It was one of the ideas we talked about but I didn't try implementing it so far since my thoughts were that we need to check for this in a loop and validate the posititon of the cursor against the bounds of the browser. Do you have any other idea which is more efficient than just running a loop, i.e. polling for such event as a listener? Not sure if it is possible.

@merks
Copy link
Contributor

merks commented Oct 17, 2024

You couldn't just loop and block the event queue. You'd need to use org.eclipse.swt.widgets.Display.timerExec(int, Runnable) and from the Runnable you can call timerExec again to test again later, detect that the hover has happened, or detect that it's time to stop checking for whatever reason, i.e., the browser control has disappeared. A bit like what this does:

https://github.com/eclipse-oomph/oomph/blob/aec695021ac7dae8811c371cd1df5583c09b4f47/plugins/org.eclipse.oomph.ui/src/org/eclipse/oomph/ui/UIUtil.java#L1271-L1341

@sratz sratz linked a pull request Oct 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
edge Edge Browser
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants