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

[Bug]: BrowserWindow.showInactive Will Restore Maximized Window #32373

Closed
3 tasks done
dsanders11 opened this issue Jan 6, 2022 · 3 comments · Fixed by #32870
Closed
3 tasks done

[Bug]: BrowserWindow.showInactive Will Restore Maximized Window #32373

dsanders11 opened this issue Jan 6, 2022 · 3 comments · Fixed by #32870
Assignees
Labels
17-x-y bug 🪲 has-repro-gist Issue can be reproduced with code at https://gist.github.com/ platform/windows
Projects

Comments

@dsanders11
Copy link
Member

dsanders11 commented Jan 6, 2022

Preflight Checklist

Electron Version

17.0.0-alpha.6

What operating system are you using?

Windows

Operating System Version

Windows 10

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

BrowserWindow.showInactive should not restore a maximized window

Actual Behavior

BrowserWindow.showInactive does restore a maximized window

Testcase Gist URL

https://gist.github.com/9f2c69b089f2155859bb0b439aefb668

Additional Information

The provided gist is a test so it should be runnable by bugbot. I've confirmed the behavior on Windows, macOS seems unaffected, I haven't tested Linux.

@ckerr, could you test Linux? It might be similar to #32350 where it affects both Windows and Linux but not macOS.

Root cause may be upstream in Chromium, ShowInactive in Electron just passes through to ShowInactive on the widget, there's really no logic present.

@dsanders11
Copy link
Member Author

I've confirmed this is a Windows-only issue, and opened a CL on Chromium to fix it: https://chromium-review.googlesource.com/c/chromium/src/+/3371573

I'll see what they say about the CL, and if it is approved I'll make a PR on Electron with a patch.

@ckerr ckerr added 17-x-y platform/windows has-repro-gist Issue can be reproduced with code at https://gist.github.com/ labels Jan 11, 2022
@ckerr ckerr added this to Unsorted Issues in 17-x-y Jan 11, 2022
@ckerr ckerr assigned ckerr and dsanders11 and unassigned ckerr Jan 13, 2022
@mlaurencin mlaurencin moved this from Unsorted Issues to Does Not Block Stable in 17-x-y Jan 13, 2022
@AbhiramL
Copy link

Hi, Im a beginner in github and was wondering if this is beginner friendly? I have experience in c++ but if this isnt beginner friendly can you direct me to issues in this project that I can help out with? Thanks a lot.

@dsanders11
Copy link
Member Author

Hi @AbhiramL! This issue isn't very beginner friendly, it involves upstream changes to Chromium, and I'm already working it. Electron has a "beginner friendly" label for issues, you can try looking at the list of issues with that label here: https://github.com/electron/electron/issues?q=is%3Aopen+is%3Aissue+label%3A%22beginner+friendly%22

aarongable pushed a commit to chromium/chromium that referenced this issue Feb 11, 2022
Use SW_SHOW/SW_SHOWNA instead of SW_SHOWNORMAL/SW_SHOWNOACTIVATE so
that the window is not restored if it is maximized.

Add tests for this behavior to ensure it is consistent across
platforms.

Refs electron/electron#32373

Change-Id: Icbaa61613906b63ed4a7d505a9b290e2e74b0025
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3371573
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Mike Wasserman <msw@chromium.org>
Commit-Queue: Mike Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/main@{#970172}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
17-x-y bug 🪲 has-repro-gist Issue can be reproduced with code at https://gist.github.com/ platform/windows
Projects
17-x-y
Does Not Block Stable
Development

Successfully merging a pull request may close this issue.

3 participants