nw.js: Window Size Bug

Hey guys,

thanks for your great work on NW.js 😃

On Windows it seems the size of the window is not correct. If I set a 1280x720 in package.json the window’s content area is a few pixel to large. See this screenshot: https://puu.sh/rqxay/a7ef6e8492.png

You can see the white borders on the screenshot. The black area is 1280x720. Its very easy to reproduce, just grab current NW.js Version (17.5) or even an older version and use the following package.json:

{
    "name": "test",
    "main": "index.html",
    "window": {
        "width": 1280,
        "height": 720,
        "title": "Game Test"
    }
}

with this in index.html: <div style="position: absolute; left: 0px; top: 0px; background-color: black; width: 1280px; height: 720px;"></div>

Not sure if I did something wrong here(?), but on OS X it works fine. It seems only on Windows this bug happens. Not sure about Linux. This is a problem for games if you want the window’s content area to match the resolution of the game. It would be cool if that can be fixed in future releases.

I remember there are pure JavaScript solutions to figure out the window’s border and title-bar sizes so maybe that could be a workaround. But it would be cool that just could be fixed.

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 28 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Will try to fix it. Thanks.

closing as this is fixed in nw2 mode.

@nylen Sorry : I mean the <html> size is 644x479 (should be 640x480).

Have you guys tested out if this can still be reproduced in the new and upcoming window implementation? It can be enabled by using one of the more recent versions and a chromium-arg inside the manifest.