[UPDATED: 25.07.2018] The Big NW.js Roundup - Tips & Tricks

  • Great thread. Thank You TheRealDannyyy.

  • Hi, I recently found this thread.

    I'd like to share the bug I found ages ago which is about window size issue.

    In short, the bug is about window size doesn't match with an intended size.

    For example, if you set the size as 640 x 360 on C2, the EXPORTED(not preview mode) project give you 651x366.

    The actual value may vary depending on NW.js version.

    If you want to know more about it, please check this two threads:

    https://www.scirra.com/forum/exported-nwjs-window-size-issue_t185331

    https://github.com/nwjs/nw.js/issues/5337

    I've updated what I've found a couple of time on the C2 closed bug one.

    Lastly, If anybody could share some workaround beside what I found, I would appreciate it.

  • Hi, I recently found this thread.

    I'd like to share the bug I found ages ago which is about window size issue.

    In short, the bug is about window size doesn't match with an intended size.

    For example, if you set the size as 640 x 360 on C2, the EXPORTED(not preview mode) project give you 651x366.

    The actual value may vary depending on NW.js version.

    If you want to know more about it, please check this two threads:

    https://www.scirra.com/forum/exported-nwjs-window-size-issue_t185331

    https://github.com/nwjs/nw.js/issues/5337

    I've updated what I've found a couple of time on the C2 closed bug one.

    Lastly, If anybody could share some workaround beside what I found, I would appreciate it.

    Thanks for sharing this in here.

    It's not looking good though, the Chromium Team seems to be ignoring this bug for almost a year now, which is always a bad sign in my experience. I've responded to the Chromium thread and I'll add it to the list of Github bugs.

    Are there any reliable workarounds for this?

    Please include the most recently affected NW.js versions, if you tested them out already (main versions are good enough, no subversions).

  • Thank you for leaving the comment, TheRealDannyyy

    So I investigated the issue with C2 r247, NW.js 0.25 and both win7 and win10 64bit.

    Here are the exported project.

    Vanilla https://drive.google.com/file/d/0B1SDO1 ... sp=sharing

    Resizable https://drive.google.com/file/d/0B1SDO1 ... sp=sharing

    Frameless https://drive.google.com/file/d/0B1SDO1 ... sp=sharing

    Here are the result I got. An intended resolution is 640x360.

    Vanilla

    Win7 651x368 Win10 650x368

    Resizable

    win7 641x361 Win10 640x360

    Frameless

    win7 640x360 Win10 640x360

    So actually the resizable does work with Win10 and it gives the closest result with win7.

    I'd say the workaroud with nwjs 0.25 is using the resizable option, though I'd like to use with non-resizable windnow.

    I wonder why this resizable option does affect the issue.

  • Thank you for leaving the comment, TheRealDannyyy

    So I investigated the issue with C2 r247, NW.js 0.25 and both win7 and win10 64bit.

    Here are the exported project.

    ...

    So actually the resizable does work with Win10 and it gives the closest result with win7.

    I'd say the workaroud with nwjs 0.25 is using the resizable option, though I'd like to use with non-resizable windnow.

    I wonder why this resizable option does affect the issue.

    Surething, always gotta push the Chromium Dev's a little so that they actually do something about it.

    It's safe to assume that the window border is somehow at fault for this. Maybe we can find a way to workaround this issue.

    Could you try out the following things on your end and share the results please (not all at once):

    • Disable "high-DPI display" in your project settings
    • Set the max/min window size using the NW.js Plugin (also try this with #3 if required)
    • Manually resize the window on start of the 1st layout using the NW.js plugin

    (No need to upload and share the files, just sharing your results is fine for this one.)

  • I did the tests with nwjs 0.25 both Win7 and 10, resizable and non-resizable.

      1. I got the same result.
      2. Win10 and non-resizable gave me "652x370". The rests are the same.
      3. I got the same result.
      2+3. Win10 and non-resizable gave me "652x370" again. The rests are the same.

    The same result refers to the post I did above.

    So it affects somewhat win10 to set window size through the plugin.

    To be clear, I did "System:set canvas size to NWjs.WindowWidth x NWjs.WindowHeight" as the manual setting.

    If that's not what you meant, please let me know.

  • I did the tests with nwjs 0.25 both Win7 and 10, resizable and non-resizable.

    ...

    The same result refers to the post I did above.

    So it affects somewhat win10 to set window size through the plugin.

    To be clear, I did "System:set canvas size to NWjs.WindowWidth x NWjs.WindowHeight" as the manual setting.

    If that's not what you meant, please let me know.

    Hmm... that's bad. I have no Win10 machine but I can reproduce it on my Win7 and 8.1 machines so the OS doesn't seem to be at fault here.

    Could you please upload the latest projectfile (capx) so that I can look into possible workarounds on my end.

    I will give you an update in here if I find something that works. For now we gotta hope that the Chromium Dev's do their work.

  • Sure, here is the capx.

    https://drive.google.com/file/d/0B1SDO1 ... sp=sharing

    The posts about the bug here can be a reference point for people struggling from it.

    I hope either we find a workaround or the chrominum team fixes the bug.

  • I think it's been a problem for a while. https://github.com/nwjs/nw.js/issues/1712

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Sure, here is the capx.

    https://drive.google.com/file/d/0B1SDO1 ... sp=sharing

    The posts about the bug here can be a reference point for people struggling from it.

    I hope either we find a workaround or the chrominum team fixes the bug.

    quote]

    I think it's been a problem for a while. https://github.com/nwjs/nw.js/issues/1712

    Thanks for the file and further information about this. Will look into possible workarounds soonâ„¢.

    I'm currently waiting for the next stable NW.js release, which usually comes out a day or two after the stable Chromium update.

    Judging by their calender it will be released on the 17th, will update this topic with a couple of other minor workarounds soon.

  • taker7 I cannot reproduce this in the latest version of NW.js on my end (while using no workarounds at all).

    Could you please check it out yourself and confirm if it's indeed fixed or not?

    My two other workarounds for the mousepointer issue and instancing issue are both no longer working, meaning that I won't update this topic anytime soon.

  • TheRealDannyyy

    Unfortunately, I still got the same result.

    Just in case, I uninstalled old nw.js and then installed the new one.

    I made a new fresh project and tested what you wrote before with win7 and 10.

    Here are the exported file and Capx. I used r247 and nwjs26. The resizable option is unchecked.

    I'm curious there are other people cannot reproduce the issue or not.

    If that's the case, there might be something wrong on my end.

  • TheRealDannyyy

    Unfortunately, I still got the same result.

    Just in case, I uninstalled old nw.js and then installed the new one.

    I made a new fresh project and tested what you wrote before with win7 and 10.

    Here are the exported file and Capx. I used r247 and nwjs26. The resizable option is unchecked.

    I'm curious there are other people cannot reproduce the issue or not.

    If that's the case, there might be something wrong on my end.

    I can reproduce it using your example, that's the strange thing about this. When I open the example and export it myself, I cannot reproduce it at all so something must be wrong with your version of NW.js I assume. (Using NW.js v0.26.0, Windows 7 64bit on a Desktop PC.)

    Can you please completely remove NW.js manually and install the most recent version from Scirra's page?

    Maybe also remove the manifest files and replace them with "reset" ones found in the How To: Add Chromium-Args & JS-Flags section. (Backup your manifest files just in case.)

  • TheRealDannyyy

    Sorry for the late reply, I finally got around to do what you suggested: uninstal NW.js and "reset" the manifest files.

    I also uninstalled and reinstalled C2. Just in case I deleted 3rd party plugins and behaviors too.

    To be clear, I tested with r247, NW.js 0.26 downloaded from Scirra's page and win7/10 64bit on desktop PC.

    I still got the same result. I did that with both win7 and 10 again.

    Did "manually uninstall NW.js" mean:

      Control Panel, Programs, Programs and Features, select NW.js and click uninstall?

    That's what I did and if that's not what you meant, could you tell me how to manually uninstall NW.js?

    Also I was wondering if you could upload your capx and exported file like I did last time so that

    I could try them out. Sorry for keeping bothering you.

    If anybody tries the test and share what you get here, I'd appreciate it.

  • TheRealDannyyy

    Sorry for the late reply, I finally got around to do what you suggested: uninstal NW.js and "reset" the manifest files.

    I also uninstalled and reinstalled C2. Just in case I deleted 3rd party plugins and behaviors too.

    To be clear, I tested with r247, NW.js 0.26 downloaded from Scirra's page and win7/10 64bit on desktop PC....

    Sorry for the late reply as well. First things first, no need to re-install NW.js or do something like that, it's not necesarry.

    I know I'm late and the most stuff is already known on Github but below you can check out my findings and experiment around yourself.

    My Observation:

    Using the information from Github it's clear that Chromium has an issue with non-resizable windows (+high DPI display). From my tests, this issue is not only affecting high DPI displays but also regular displays. Feel free to test it out on your end and post your results.

    My Tests:

    Files & Requirements:

    Issue #1 - Window Size Issue (Exported Version):

    • Set "Use high-DPI display" to YES/NO
    • Export your project (Window Frame: YES | Resizable Window: NO | Kiosk Mode: NO)
    • Notice incorrect window size regardless of the DPI setting

    Issue #2 - Not Resizable Action Is Broken (?):

    • Preview the project (in-editor or exported, doesn't matter)
    • Enable advanced settings
    • Click on "Resizable Window OFF"
    • Try to resize the window (should be possible even though it's disabled)
    • Click on "Resizable Window OFF" and notice that you can resize it again

    Last Words:

    I've included a possible workaround that you can try out but it's not perfect and "hacky", that's why the event-structure might look a bit weird at first.

    I might post a reply in the Github thread with all the new information soon but for now we have to wait for the Chromium Dev's to do their work.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)