nwjs / nw.js

Call all Node.js modules directly from DOM/WebWorker and enable a new way of writing applications with all Web technologies.
https://nwjs.io
MIT License
40.39k stars 3.88k forks source link

Window with size based on `nw.Screen.screens[0].bounds` doesn't fill screen in Windows #8085

Open sysrage opened 1 year ago

sysrage commented 1 year ago

Issue Type

Before opening an issue, please search and see if it has already been raised.

Current/Missing Behavior

In Windows, opening a window with height and width based on nw.Screen.screens[0].bounds doesn't actually fill the screen. This does work properly in both macOS and Linux.

Expected/Proposed Behavior

When setting a window size to fill the screen, it should fill the screen.

Additional Info

nw.Window.open('a.html', { height: nw.Screen.screens[0].bounds.height, width: nw.Screen.screens[0].bounds.width });

Note that these bounds do match the resolution size, but the window that's created is smaller.

vulcan9 commented 1 year ago

how about this?

let bounds = nw.Screen.screens[0].bounds;
let scaleFactor = nw.Screen.screens[0].scaleFactor;
nw.Window.open('a.html', {
    height: bounds.height * scaleFactor,
    width: bounds.width * scaleFactor
});

You can also force the scaleFactor value to be fixed. (#5675 )

"chromium-args" : "--force-device-scale-factor=1"
sysrage commented 1 year ago

@vulcan9 neither of your suggestions make a difference. Scaling was already "1".