8000 fix: offscreen rendering with correct screen info. by reitowo · Pull Request #48730 · electron/electron · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@reitowo
Copy link
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
8000 @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
Copy link
Member
@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

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

API LGTM

@itsananderson
Copy link
Member

API LGTM

@reitowo reitowo force-pushed the main-osr-screen-info branch from dee50ee to 7d86785 Compare November 25, 2025 16:16
@jkleinsc
Copy link
Member
jkleinsc commented Jan 6, 2026

@reitowo can you rebase this PR? Hopefully now with the quiet period over, we can get this PR moving forward.

@reitowo reitowo force-pushed the main-osr-screen-info branch 2 times, most recently from f031156 to a4727ae Compare January 8, 2026 17:01
@codebytere
Copy link
Member

@reitowo needs another rebase i think

@reitowo reitowo force-pushed the main-osr-screen-info branch 2 times, most recently from c690b2e to c7ba5c5 Compare January 18, 2026 16:29
@reitowo reitowo force-pushed the main-osr-screen-info branch from c7ba5c5 to fee59dd Compare January 18, 2026 16:30
@reitowo
Copy link
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
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
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
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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

offscreen will invalid media queries

6 participants

0