fix: offscreen rendering with correct screen info. #49494
Conversation
6977c7f to
0bb5475
Compare
0bb5475 to
3689f9a
Compare
|
This patch didn't change the breaking change yet. The breaking change will be merged on main at another PR #49683. This still the old behavior so should be good. |
|
I see! Sorry, I understand now. The breaking change was documented in this PR, but the actual breaking change lands separately. My bad 🙇 |
Co-authored-by: reito <reito@chromium.org>
3689f9a to
cd64d48
Compare
jkleinsc
left a comment
There was a problem hiding this comment.
Breaking changes should not be included as they do not apply to 41-x-y.
| ## Planned Breaking API Changes (42.0) | ||
|
|
||
| ### Behavior Changed: Offscreen rendering will use `1.0` as default device scale factor. | ||
|
|
||
| Previously, OSR used the primary display's device scale factor for rendering, which made the output frame size vary across users. | ||
| Developers had to manually calculate the correct size using `screen.getPrimaryDisplay().scaleFactor`. We now provide an optional property | ||
| `webPreferences.offscreen.deviceScaleFactor` to specify a custom value when creating an OSR window. At first, if the property is not set, it defaults | ||
| to the primary display's scale factor (preserving the old behavior). Starting from Electron 42, the default will change to a constant value of `1.0` | ||
| for more consistent output sizes. | ||
|
|
There was a problem hiding this comment.
These breaking changes should not be backported to 41-x-y because they do not apply to 41-x-y
There was a problem hiding this comment.
These were decided to apply after 3 major versions at around 40 so I think it should be added to tell "Planned Breaking Change"? (as an early announcement)
There was a problem hiding this comment.
Since https://www.electronjs.org/docs/latest/breaking-changes pulls from main, the breaking change update really only needs to be present in main.
jkleinsc
left a comment
There was a problem hiding this comment.
PR needs to be rebased to fixup up conflicts
|
See #50375 |
Backport of #48730
See that PR for details.
Notes:
webPreference.offscreen.deviceScaleFactorto allow user specify a value, instead of using user's primary display's value.