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.maximize Does Not Show Window on macOS #32947
Comments
@dsanders11 I think this fix is not complete. From the docs:
With your change, the window will still not be visible but rather put behind the "key" (active) window. I would expect that the window is put above the active window and thus becomes visible. |
The associated PR here simply calls through to That said, I can't reproduce this. In my testing it puts the second, unfocused window in front in z-order. Here's the fiddle I'm using to test, on macOS 12.4 and Electron v20.0.0-alpha.1. The second (unshown) window is maximized after 8 seconds. In my tests, it always put above the active window, but does not take focus (as expected). If you have a reproduce case, happy to take a look. But I'd suspect any buggy behavior will be in |
@dsanders11 yeah, I am also trying out in a Fiddle and I do not see the behaviour of VSCode, but I suspect this is due to how the issue reproduces in VS Code: users have reported that this issue reproduces when they launch VS Code from a terminal while VS Code is already running, so this also involves VS Code being inactive as application and another instance of VS Code trying to bring the first instance to front. To clarify:
To clarify: in VS Code we have a condition that sets |
Opened: #34368 |
Preflight Checklist
Electron Version
19.0.0-nightly.20220209
What operating system are you using?
macOS
Operating System Version
macOS 11.6.2
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
Maximizing a window which isn't being shown should show the window. According to the docs for
BrowserWindow.maximize()
:Actual Behavior
On macOS, the window is not shown, but
window.isMaximized()
returns true, and a subsequentwindow.show()
will show a maximized window as expected.Testcase Gist URL
https://gist.github.com/09e5ef031f69be2cce1e23c5174d6e5b
Additional Information
Tested on Windows 10 and Ubuntu and it works as expected, so this looks to be just macOS.
The text was updated successfully, but these errors were encountered: