MicrosoftEdge / WebView2Feedback

Feedback and discussions about Microsoft Edge WebView2
https://aka.ms/webview2
453 stars 55 forks source link

WebView2 Tooltips #3826

Open brigilvincent opened 1 year ago

brigilvincent commented 1 year ago

Description When WebView2 window stretched across two monitors, tooltips of DIV displayed in first monitor gets displayed in left edge of second monitor.

Version SDK: 1.0.1901.177 Runtime: 115.0.1901.203 Framework: Win32 OS: Win11/Win10

Regression Was this working before but has regressed? no If yes, what version did this last work on? na

Repro Steps

  1. Host WebView2 on a Win32 window
  2. Navigate to a page having DIV tooltips based on DIV's "title" attribute
  3. Resize the window to stretch it across two display monitors and try to hover over the DIV to confirm display location of the tooltip

Expected behavior: Tooltip will display in the same position as the corresponding DIV is displayed.

Actual behavior: When the window is positioned based on first monitor, tooltip location is good (i.e. same location as the DIV location). But as soon as the second monitor takes over the window as it's major portion moved over to second monitor (eg: MonitorFromWindow starts to return handle to second monitor or the window starts to honor DPI of second monitor), the tooltip displayed in left-most edge of the second monitor even though the DIV is still in first monitor.

Additional Info image

AB#47053644

johna-ms commented 1 year ago

Hi sorry for the late response, this one fell through the cracks for me. @brigilvincent I'm unable to repro this. Could you post some example html of how you're doing the tooltip or link a sample repro app?

brigilvincent commented 1 year ago

@johna-ms Thank you very much for the updates!

Let me share following samples to reproduce the issue. 1) HTML page with tooltip (Refer Sample.html) 2) Win32 application hosting WebView2 which rendered the same "Sample.html" (Refer WebView2Tooltip folder)

Please mouse hover on the UI element with text "Hover over me" to see the tooltip. Tooltip will be in expected location when the window is in a single monitor. Please resize/stretch the window across two monitors in such a way that 50% or more of the window is in second monitor where as the UI element "Hover over me" is still on first monitor. Try mouse hover on the UI element with text "Hover over me" again. The tooltip will be shown in left edge of the second monitor instead of closer to the UI element "Hover over me".

Thank you very much for your help!

WebView2Tooltip.zip

johna-ms commented 1 year ago

Ok thanks for that. I'm getting a repro now. My issue was my monitors are different sizes so I had to run them at the same resolution to fulfill the 'more than 50% of the webview' criteria. We'll track this on our side and look into it. Thank you for reporting this!