NW.js version 0.18.0 beta 1 starts with a greater `window.devicePixelRatio` than the previous versions
See original GitHub issueThis issue is observed on Windows 7 where the system’s control panel setting for font size and other elements is 125%, see the screenshot:
NW.js version 0.18.0 beta 1, unlike the previous NW.js versions, seems to observe this (system-wide) setting and starts with window.devicePixelRatio
equal to 1.25
, see the screenshot:
As a result,
- text is larger (in all windows) than in the previous versions of NW.js,
- images are also larger, raster images become blurry and not pixel-perfect any longer (such as icons in “Developer Tools” console on the above screenshot).
This issue may be seen either as a bug (because raster images lose their pixel-to-pixel perfection) or as an intended behaviour (because NW.js now adheres to an additional system-wide setting).
If it’s a bug, it should be fixed.
If it’s an improvement, there should be a known (documented in release notes) setting to opt out of it. (For example, users of Mozilla Firefox may set layout.css.devPixelsPerPx
to 1
on their about:config
; is there anything like that in Chromium settings controlled by the file package.json
of a NW.js-based application?)
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (11 by maintainers)
Top GitHub Comments
@Mithgol Hi there! Solution 1 did it. I simply added “chromium-args” : “–force-device-scale-factor” on package.json file right after the window option list and everything is as on previous NW.JS version. Thanks a lot for your help. Regards
For the record, the alternative hack of
body { zoom: reset; }
stopped working in NW.js v0.23.x and thus"chromium-args": "--force-device-scale-factor"
is the only remaining solution.