Skip to content

38.2.0 changed how app.focus() works on Linux #48737

@ravicious

Description

@ravicious

Preflight Checklist

Electron Version

38.2.0

What operating system(s) are you using?

Ubuntu

Operating System Version

24.04.03

What arch are you using?

arm64 (including Apple Silicon)

Last Known Working Electron version

38.1.2

Does the issue also appear in Chromium / Google Chrome?

I don't know how to test

Expected Behavior

app.focus() focuses on the first visible window.

https://www.electronjs.org/docs/latest/api/app#appfocusoptions

Actual Behavior

app.focus() shows a notification saying "[app name] is ready" and does not focus on the window.

Testcase Gist URL

https://gist.github.com/5a8dd6f127bfed24b92c4797250c6ed3

Additional Information

The repro calls app.focus() 2.5s after launching the app. Once the app starts, click on the Electron Fiddle window to switch focus away from the repro app. After 2.5s, you should see the notification on Electron 38.2.0+. This does not repro on 38.1.2 or latest 37 (37.8.0).

I observed this issue on both Ubuntu and Fedora.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions