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

[NW2] Regression in window sizing #7284

Closed
AshleyScirra opened this issue Dec 19, 2019 · 7 comments
Closed

[NW2] Regression in window sizing #7284

AshleyScirra opened this issue Dec 19, 2019 · 7 comments

Comments

@AshleyScirra
Copy link

AshleyScirra commented Dec 19, 2019

NWJS Version : 0.43.1
Operating System : Windows 10 64-bit

Expected behavior

Setting a window size in NW2 should set the same size as before

Actual behavior

Setting the same size produces a different window size in NW2 mode

How to reproduce

Minimal repro: nw2-window-size.zip

This just sets the window size to 500x500.

Using alt+printscreen and pasting in to image editor to get the overall window size:
By default (with NW2): window size is 486x493
With --disable-features=nw2: window size is 502x528

@TheRealDannyyy
Copy link

Would appreciate a fix before the NW1 removal (#7230).

@rogerwang
Copy link
Member

Will look into it soon.

btw, I recently clarified the setting of inner/outer dimension if the window: 9ea8972#diff-e3e2a9bfd88566b05001b02a3f51d286
So the behaviour would be different with NW1.

@rogerwang
Copy link
Member

rogerwang commented Dec 28, 2019

In your test case it's setting the outer dimension of the window, which is actually set correctly (see the attached screenshot). The window under windows has a thick invisible resize handle. For the sake of cross-platform consistent application behaviour I suggest setting the inner dimension of your application's window, which is the size of the DOM window area.

windowsize

See also the upstream code here for the thick resize handle: https://cs.chromium.org/chromium/src/chrome/browser/ui/views/frame/glass_browser_frame_view.cc?rcl=9db6c8c8e3374ea24d5705672a7a33d26cb6be37&l=358

@rogerwang
Copy link
Member

closing for now as it's working as expected.

@AshleyScirra
Copy link
Author

I suggest setting the inner dimension of your application's window, which is the size of the DOM window area.

How do we do that? I'm not aware of an API for that - the NW.js Window API appears to only specify one size, which according to your comment, is now the outer size.

@rogerwang
Copy link
Member

The inner dimension can be set via Window.resizeTo() or the manifest as described by the documentation. Thanks.

@AshleyScirra
Copy link
Author

Using resizeTo() seems buggy - I filed #7303 for that.

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