Skip to content

Windows: Restore (after minimize) to wrong window size #7951

Closed

Description

@simast
  • Electron version: 1.4.6
  • Operating system: Windows 10

Expected behavior

After minimizing the window it should restore to the same size.

Actual behavior

After minimizing the window it is restored to a larger width.

How to reproduce

The issue started with Electron 1.4.5 and will only appear when you use minWidth property in browser window config. As an example:

const windowConfig = {
	title: "Test app",
	width: 800,
	height: 600,
	minWidth: 800
};

const mainWindow = new BrowserWindow(windowConfig);

Activity

  1. MarshallOfSound commented on Nov 12, 2016

    @MarshallOfSound
    Member

    Interesting on my setup I get the following results.

    Config width Config minWidth width after restore
    800 800 944
    500 500 644
    700 500 700

    Looks to incorrectly have a minWidth bound of 144 too big. I'll look into this more

  2. MarshallOfSound commented on Nov 12, 2016

    @MarshallOfSound
    Member

    @zcbenz I started fixing this then remembered I saw similar code to what I was writing before. It was removed in a recent PR.

    https://github.com/electron/electron/pull/7766/files#diff-a2a9d45b70c38bec45928975c3a3a6a1L214

    Perhaps we should roll that PR back and attempt to fix the issue in #7630 in a different way that is consistent with the fixes that were deleted in that PR that we really still need.

  3. zcbenz commented on Nov 17, 2016

    @zcbenz
    Contributor

    @MarshallOfSound Sounds good to me to revert the PR.

  4. kevinsawicki commented on Nov 22, 2016

    @kevinsawicki
    Contributor

    Fixed by #8047

  5. stormsc1 commented on Nov 30, 2020

    @stormsc1

    Why is this still a problem?

  6. CahierX commented on Apr 13, 2022

    @CahierX

    This problem is still present on Window11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions