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

Window width increases when application is restored after minimized. #253

Closed
CommissarXiii opened this issue Dec 12, 2012 · 9 comments
Closed
Labels

Comments

@CommissarXiii
Copy link

I'm noticing an increase in window width when the application is restored from the taskbar (Windows 7, 64-bit) after it has been minimized.

This happens even when resizable is set to false, or when all the height and width options (default, min, max) are set to the same value in package.json - in my case 1024w X 768h.

See the attached image for an example.
restore_width_issue

Thanks!

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@katanacrimson
Copy link

I'm hitting this bug as well.

Using node-webkit 0.5.1, Win7 x64

@katanacrimson
Copy link

@CommissarXiii As a workaround, are you able to use DOM events (window.resize) to undo and revert the window size change?

I might give this a shot later to see if I can whip up a client-side workaround for this, but we really do need a proper fix in node-webkit itself.

@katanacrimson
Copy link

Has this been looked into further? This is a major annoyance within a windows environment.

@HaiColon
Copy link

I can work around this by catching the minimize event, save the window width, catch the restore event and then setting the window width back to the saved width, but when you hide the window with [Windows key]+d, a user of my app just reported to me that this workaround doesn't work, so I'd guess the minimize event doesn't get triggered in that case.

dryabov added a commit to dryabov/twister-webkit that referenced this issue Mar 7, 2014
@studiochris
Copy link

This is still an issue in the 0.8 branch. It does not appear to affect frameless windows. Is there some type of compensation being made for the window frame on Windows that would cause this (beyond the initial addition of width so the viewport matches package.json)?

Console Output showing the issue. window.frame == require("nw.gui").Window.get()

window.frame.width
716 (set to 700 in package.json)
window.frame.height
638 (set to 600 in package.json)
window.frame.minimize();
undefined
window.frame.restore();
undefined
window.frame.width
780
window.frame.height
638
window.frame.resizeTo(716,638);
undefined
window.frame.minimize();
undefined
window.frame.restore();
undefined
window.frame.width
780

Workaround from the above commit seems to resolve the issue (removing min_width and min_height from package.json), but it is a poor substitute.

@leixu2txtek
Copy link

+studiochris removed the min_width and min_height

then worked fine...

we need set min_width and min_height in app ..

@823639792
Copy link

or set "frame": false,

@stale
Copy link

stale bot commented Nov 15, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 15, 2017
@stale stale bot closed this as completed Nov 18, 2017
@32u2
Copy link

32u2 commented Jan 20, 2018

I figured out the condition under which this still happens in Windows ("nwVersion": "0.27.5"). If the second monitor is present and this monitor has non-standard display settings ('Scale and layout', size of text set at 125%, or higher), upon restoring from the minimized, or maximized state, the scaling for the primary monitor is applied irrespective of which monitor the app resided in the last time it was in the normal state.

This unwanted window resizing will also appear after dragging the window from one display to another and back.

The two hooks below worked for me:

nw.Window.get().on('restore', function() {
this.width = 1272
this.height = 720
});

nw.Window.get().on('move', function() {
this.width = 1272
this.height = 720
});

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

No branches or pull requests

8 participants