Skip to content

Use explicit solid background color for WebView on WinForms#4434

Merged
mhsmith merged 1 commit into
beeware:mainfrom
johnzhou721:webview-work
Jun 3, 2026
Merged

Use explicit solid background color for WebView on WinForms#4434
mhsmith merged 1 commit into
beeware:mainfrom
johnzhou721:webview-work

Conversation

@johnzhou721
Copy link
Copy Markdown
Contributor

Fixes #3264 by repainting the background that the WebView is blended behind explicitly using the WebView's APIs, rather than assuming a transparent background; although this does not uncover the root cause of #3264, it is a full fix for the reported issue, as the background is always painted immediately on resizing, and thus no artifacts are ever visible.

PR Checklist:

  • I will abide by the BeeWare Code of Conduct
  • I have read and have followed the CONTRIBUTING.md file
  • This PR was generated or assisted using an AI tool

Assisted-by:

Fixes beeware#3264 by repainting the background that the WebView is blended behind explicitly using the WebView's APIs,
rather than assuming a transparent background; although this does not uncover the root cause of beeware#3264, it is a
full fix for the reported issue, as the background is always painted immediately on resizing, and thus no artifacts
are ever visible.
@johnzhou721
Copy link
Copy Markdown
Contributor Author

johnzhou721 commented May 31, 2026

Note the conflict with #4431, since the default background color is set on the Toga side, and #4431 changes that mecahnism.

EDIT (I sent early) I'd therefore appreciate this PR to be reviewed and merged first.

Copy link
Copy Markdown
Member

@phildini phildini left a comment

Choose a reason for hiding this comment

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

Given that this seems to conform to other places we do this, this looks fine.

Could you take a look at https://toga.beeware.org/en/stable/how-to/contribute/how/submit-pr/#pull-request-content and make sure the title of the PR conforms?

@johnzhou721 johnzhou721 changed the title Fix for #3264 Use explicit solid background color for WebView on WinForms Jun 1, 2026
@johnzhou721
Copy link
Copy Markdown
Contributor Author

@phildini Done! Thanks for the guidance.

Copy link
Copy Markdown
Member

@mhsmith mhsmith left a comment

Choose a reason for hiding this comment

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

Confirmed that this fixes the example app in the original issue.

@mhsmith mhsmith merged commit 4b1f952 into beeware:main Jun 3, 2026
65 checks passed
johnzhou721 added a commit to johnzhou721/toga that referenced this pull request Jun 5, 2026
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.

WebView has rendering glitches on Windows in high DPI mode

3 participants