Skip to content

fix: offscreen rendering with correct screen info. #48730

Merged
jkleinsc merged 1 commit into
electron:mainfrom
reitowo:main-osr-screen-info
Jan 22, 2026
Merged

fix: offscreen rendering with correct screen info. #48730
jkleinsc merged 1 commit into
electron:mainfrom
reitowo:main-osr-screen-info

Conversation

@reitowo
Copy link
Copy Markdown
Member

@reitowo reitowo commented Oct 29, 2025

Description of Change

Previously OSR doesn't have a valid screen info, the media query of (device-width: 1920px) will be always invalid. This fix partially checked CEF's implementation and made some modification so that the OffScreenRenderWidgetHostView can update correct screen info based on OSR window's size and scale factor.

Closes #47835

Checklist

Release Notes

Notes:

  • Fixed a bug that cause offscreen rendering doesn't have valid screen info and unable to get valid result of related media queries.
  • Added webPreference.offscreen.deviceScaleFactor to allow user specify a value, instead of using user's primary display's value.

@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Oct 29, 2025
@reitowo reitowo force-pushed the main-osr-screen-info branch from 4bce604 to d9cbb87 Compare October 29, 2025 17:17
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Nov 5, 2025
@reitowo reitowo force-pushed the main-osr-screen-info branch 6 times, most recently from 7be4173 to 230c136 Compare November 7, 2025 18:43
@reitowo reitowo marked this pull request as ready for review November 7, 2025 18:44
@reitowo reitowo requested review from a team as code owners November 7, 2025 18:44
@reitowo reitowo requested a review from a team November 7, 2025 18:45
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Nov 7, 2025
@reitowo reitowo added target/38-x-y PR should also be added to the "38-x-y" branch. target/39-x-y PR should also be added to the "39-x-y" branch. target/40-x-y PR should also be added to the "40-x-y" branch. target/37-x-y PR should also be added to the "37-x-y" branch. labels Nov 7, 2025
@reitowo reitowo force-pushed the main-osr-screen-info branch from 230c136 to c9a426f Compare November 8, 2025 05:36
@reitowo reitowo removed target/37-x-y PR should also be added to the "37-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch. target/39-x-y PR should also be added to the "39-x-y" branch. labels Nov 8, 2025
@codebytere codebytere added the semver/patch backwards-compatible bug fixes label Nov 9, 2025
@electron-cation electron-cation Bot added new-pr 🌱 PR opened recently and removed new-pr 🌱 PR opened recently labels Nov 9, 2025
@jkleinsc jkleinsc added semver/minor backwards-compatible functionality and removed semver/patch backwards-compatible bug fixes labels Nov 10, 2025
@reitowo reitowo force-pushed the main-osr-screen-info branch from c7ba5c5 to fee59dd Compare January 18, 2026 16:30
@reitowo
Copy link
Copy Markdown
Member Author

reitowo commented Jan 18, 2026

Rebased.

@github-actions github-actions Bot added the target/41-x-y PR should also be added to the "41-x-y" branch. label Jan 19, 2026
@reitowo
Copy link
Copy Markdown
Member Author

reitowo commented Jan 22, 2026

@MarshallOfSound Could we skip the check as Windows arm64 & amd64 is failling alternatively.

@erickzhao erickzhao added semver/minor backwards-compatible functionality and removed semver/minor backwards-compatible functionality labels Jan 22, 2026
@jkleinsc jkleinsc merged commit e314286 into electron:main Jan 22, 2026
337 of 344 checks passed
@release-clerk
Copy link
Copy Markdown

release-clerk Bot commented Jan 22, 2026

Release Notes Persisted

  • Fixed a bug that cause offscreen rendering doesn't have valid screen info and unable to get valid result of related media queries.
  • Added webPreference.offscreen.deviceScaleFactor to allow user specify a value, instead of using user's primary display's value.

@trop
Copy link
Copy Markdown
Contributor

trop Bot commented Jan 22, 2026

I was unable to backport this PR to "40-x-y" cleanly;
you will need to perform this backport manually.

@trop trop Bot added needs-manual-bp/40-x-y and removed target/40-x-y PR should also be added to the "40-x-y" branch. labels Jan 22, 2026
@trop
Copy link
Copy Markdown
Contributor

trop Bot commented Jan 22, 2026

I have automatically backported this PR to "41-x-y", please check out #49494

@trop trop Bot added in-flight/41-x-y and removed target/41-x-y PR should also be added to the "41-x-y" branch. labels Jan 22, 2026
@trop
Copy link
Copy Markdown
Contributor

trop Bot commented Feb 5, 2026

@reitowo has manually backported this PR to "40-x-y", please check out #49681

@trop
Copy link
Copy Markdown
Contributor

trop Bot commented Mar 19, 2026

@reitowo has manually backported this PR to "41-x-y", please check out #50375

@trop trop Bot added merged/41-x-y PR was merged to the "41-x-y" branch. and removed in-flight/41-x-y labels Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-review/approved ✅ api-review/requested 🗳 merged/40-x-y PR was merged to the "40-x-y" branch. merged/41-x-y PR was merged to the "41-x-y" branch. semver/minor backwards-compatible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

offscreen will invalid media queries

6 participants