Skip to content

[NW2] Issues using resizeTo() as replacement for assigning window width/height #7303

Description

@AshleyScirra

NWJS Version : reproduces in 0.43.1 & 0.44.0-beta1
Operating System : Windows 10 x64

Expected behavior

Be able to use win.resizeTo() as a replacement for assigning window width and height in NW2 (as suggested in #7284).

Actual behavior

In NW2 mode, window.resizeTo() is buggy when used as a replacement for assigning the window width and height. There are two issues:

  • Using two calls to resizeTo() to set the width then the height causes only the height to be set. The width is lost. This is important for backwards compatibility, e.g. if calling code sets the size via separate width and height setters in calling code, which matches the old API.
  • Each call to resizeTo() actually changes the position of the window as well. The window position ought to stay the same size.

How to reproduce

Minimal repro:
nw2-resizeto-issues.zip

Click "Resize" button.
Expected: window inner size to read 600x600; window position to stay in the same place
Observed: window inner size reads 484x600 (only height was set); window position moves to left

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions