microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.25k stars 671 forks source link

WebView2 right click menu does not follow cursor after moving window #9688

Open HO-COOH opened 2 months ago

HO-COOH commented 2 months ago

Describe the bug

As title suggest.

Steps to reproduce the bug

  1. Opens winui3 gallery to webview2 page
  2. Right click in the webview2
  3. Move the gallery window, right click again, now the menu appears at a wrong position.

Expected behavior

Menu should opens at pointer position.

Screenshots

https://github.com/microsoft/microsoft-ui-xaml/assets/42881734/9a528214-cc3b-4c91-9b9e-ee6ae54530a8

NuGet package version

WinUI 3 - Windows App SDK 1.5.3: 1.5.240428000

Windows version

Windows 10 (1809): Build 17763

Additional context

No response

github-actions[bot] commented 2 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

codendone commented 2 months ago

Note: The biggest issue here is that the menu no longer opens at the right position after moving the window. The WebView2 code attempts to update the position, but that only happens currently if XAML renders (because WebView2 is using CompositionTarget.Rendered event to check for changes). We may need to update the position on more events, or see if there is an API available yet to catch when the window position changes.