Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash with Windows UI scaling and window positions 'center' and 'mouse' #7414

Closed
sysrage opened this issue Mar 15, 2020 · 7 comments
Closed

Comments

@sysrage
Copy link

sysrage commented Mar 15, 2020

NWJS Version : 0.44.4
Operating System : Windows 10 x64

Expected behavior

The window should appear centered in the screen, when position: 'center' is used. The window should appear at the mouse cursor, when position: 'mouse' is used.

Actual behavior

When a package.json manifest contains position: 'center', the application never starts when NW.js 0.44.4 is being used. Additionally, if the manifest contains position: 'mouse', the window shows in the top-left of the screen (not where the mouse is).

Downgrading NW.js back to 0.44.3 immediately resolves both issues. Running NW.js 0.44.4 with --disable-features=nw2 also resolves the issues.

How to reproduce

nw.Window.open(startUrl, { position: 'center' }, (mainWindow) => {});

OR

nw.Window.open(startUrl, { position: 'mouse' }, (mainWindow) => {});
@sysrage
Copy link
Author

sysrage commented Mar 15, 2020

This issue should block issue #7230.

@gpetrov
Copy link

gpetrov commented Mar 15, 2020

Maybe this is related to the crashes we are experiencing as well: see #7412

@rogerwang
Copy link
Member

@sysrage I tried the code by opening nw and enter it in the devtools. It works for me.

Please provide a sample so I can reproduce the crash, thanks.

@sysrage
Copy link
Author

sysrage commented Mar 16, 2020

There might be something strange going on, as the following code has not failed once or twice in my testing. However, it usually does fail (tested on two computers). Also, passing the --disable-features=nw2 parameter is no longer fixing the problem. Once it starts failing, it continues to fail until I remove position: 'center' from main.js.

package.json:

{
    "name": "nw-fail",
    "main": "./main.js",
    "homepage": "."
}

main.js

nw.Window.open('./index.html', { position: 'center' }, (mainWindow) => {});

index.html

Any HTML Here.

@sysrage
Copy link
Author

sysrage commented Mar 16, 2020

I believe this issue is related to Windows UI scaling. If I have "Change the size of text, apps, and other items" set to 175% in Display Settings, NW.js crashes with position: 'center'. If I set scaling to 100%, the window opens just fine.

I can consistently reproduce this with 175% scaling on two computers:
1 - Windows 10.0.18363.720 and NVIDIA Quadro driver 432.13 (1x 4K Monitor)
2 - Windows 10.0.18363.720 and NVIDIA GeForce driver 442.50 (2x QHD Monitors)

@sysrage sysrage changed the title Failures with window positions 'center' and 'mouse' Crash with Windows UI scaling and window positions 'center' and 'mouse' Mar 16, 2020
@sysrage
Copy link
Author

sysrage commented Mar 17, 2020

This behavior appears to be resolved with the 0.44.5 test build mentioned in Issue #7412 (https://dl.nwjs.io/live-build/nw44/20200316-123559/b37f3d15b/v0.44.5/).

@rogerwang
Copy link
Member

Close as the fix is released in 0.44.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants