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

[WebView2] Apply text scale factor to CoreWebView2 content #8540

Merged
merged 1 commit into from
Jun 13, 2023

Conversation

DmitriyKomin
Copy link
Contributor

WebView2 was not accounting for system text scale (OS Settings | Accessibility | Text Size) while the rest of Xaml UI did, resulting in ignored accessibility preference and discrepancy of text size between WV2 and other Xaml content. An additional side effect was that, when text scale is set, WV2 context menus (right-click over web content) were sometimes rendered at wild offsets, showing up completely detached from click point (this usually happened when right-clicking near right/bottom edges of WV2).

Fix this by incorporating UISettings.TextScaleFactor when setting CoreWebView2 scale via ICoreWebView2Controller3::RasterizationScale. Also register for changes to the TextScaleFactor so we can update CoreWebView2 accordingly.

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Jun 10, 2023
Copy link
Contributor

@codendone codendone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@DmitriyKomin DmitriyKomin self-assigned this Jun 11, 2023
@DmitriyKomin
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DmitriyKomin DmitriyKomin merged commit b480471 into main Jun 13, 2023
32 checks passed
@DmitriyKomin DmitriyKomin deleted the user/dkomin/wv2_testscale_fix branch June 13, 2023 04:43
@bpulliam bpulliam removed the needs-triage Issue needs to be triaged by the area owners label Jun 30, 2023
kmahone pushed a commit that referenced this pull request Jul 7, 2023
kmahone added a commit that referenced this pull request Jul 7, 2023
Includes these fixes:
* [Fix Deprecated icons ](#8576)
* [Fix Voice Access 'Show Bubbles' annotation of WebView2 Content](#8551)
* [Add const keyword to resolve warnings (treated as errors) C26462 and C26496](#8567)
* [[WebView2] Apply text scale factor to CoreWebView2 content](#8540)
* [Fix horizontal scrolling on trackpad](#8403)
ronanlee777 added a commit to ronanlee777/csharp-microsoft that referenced this pull request Aug 5, 2024
Includes these fixes:
* [Fix Deprecated icons ](microsoft/microsoft-ui-xaml#8576)
* [Fix Voice Access 'Show Bubbles' annotation of WebView2 Content](microsoft/microsoft-ui-xaml#8551)
* [Add const keyword to resolve warnings (treated as errors) C26462 and C26496](microsoft/microsoft-ui-xaml#8567)
* [[WebView2] Apply text scale factor to CoreWebView2 content](microsoft/microsoft-ui-xaml#8540)
* [Fix horizontal scrolling on trackpad](microsoft/microsoft-ui-xaml#8403)
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.

3 participants