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
fix: explicitly focus window on win.show() #18046
Conversation
Release Notes Persisted
|
I have automatically backported this PR to "4-1-x", please check out #18079 |
I have automatically backported this PR to "5-0-x", please check out #18080 |
I have automatically backported this PR to "6-0-x", please check out #18081 |
Does this fix #2867? |
I've now tested, and this doesn't fix #2867, see comments there for my workaround. |
Thanks @jwheare |
@softremake ah that’s just a custom event I listen to in the main process to show and focus the main window https://github.com/irccloud/irccloud-desktop/blob/694923a20efd42bcc09943c8167c8fcffb3f0a01/app/main.js#L211 |
still have the problem in electron 16.0.2, when i hide a window, then from main process call show(), still loss focus.tried many methods, still doesn't work |
Description of Change
Fixes #18034.
Our documentation for
win.show
says that this explicitly gives the window focus, and on macOS we implementShow
withunhide
and so this rings true.However, this is not true on Windows, which is implemented in
NativeWindowViews
. This PR fixes that issue by explicitly focusing the window withwidget()->Activate()
.cc @MarshallOfSound @deepak1556 @zcbenz
Checklist
npm test
passesRelease Notes
Notes: Fixed an issue on Windows where calling
.show()
on a BrowserWindow did not focus the window.