Skip to content

Window does not take into account the specified Height and Width if it is launched in the minimised state #13300

Closed
@flexxxxer

Description

@flexxxxer

Describe the bug

If you set the Window.WindowState property in the constructor to WindowState.Minimised, then the window after unfolding (transition to WindowState.Normal) will not take into account the previously set (for example, through ViewModel or just in the constructor) Window.Width and Window.Height.

To Reproduce

  1. Clone this repo
  2. See these lines: MainWindow.Width, .Height and .WindowState are set in the constructor.
  3. Build and run app: window will be in minimized state.
  4. After opening an application window (e.g. clicking in the taskbar), the application window will have a different size than the one specified.

Expected behavior

Application window size after application opening corresponds to the values set in the constructor.

Screenshots

video_H.264.mp4

Environment

  • OS: Windows 11
  • Avalonia-Version: reproduced on 0.10.5, 0.10.10, 0.10.21, 11.0.0, 11.0.1, 11.0.2, 11.0.3, 11.0.4, 11.0.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughelp-wantedA contribution from the community would be most welcome.os-windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions