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]: The focus method of a Window object doesn't bring the window to front #29016

Closed
3 tasks done
XanderEmu opened this issue May 5, 2021 · 2 comments
Closed
3 tasks done
Labels

Comments

@XanderEmu
Copy link

Preflight Checklist

Electron Version

12.0.6

What operating system are you using?

Windows

Operating System Version

Windows 10 Pro 2004

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

  • The app opens a child window using window.open method (nativeWindowOpen is set to true).
  • User clicks on a button that is supposed to bring the previously opened window to front. The app calls win.focus() on a said child window object.
  • The child window should appear above the main window.

Actual Behavior

Nothing happens when win.focus() is called.

Testcase Gist URL

No response

Additional Information

When running (almost) the same code as a web app (in Chrome), the focus method brings the window to the top.

There was a similar issue reported a few years back:
#2867

@pushkin-
Copy link

pushkin- commented May 5, 2021

If I'm not mistaken, the linked issue was more about calling BrowserWindow::focus() (on the Electron side), not win.focus() on the browser side. This looks like a dupe of this

@nornagon
Copy link
Member

nornagon commented May 5, 2021

Duplicate of #25578

@nornagon nornagon marked this as a duplicate of #25578 May 5, 2021
@nornagon nornagon closed this as completed May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants