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

fix: restore non-panel focus behavior #42180

Merged
merged 1 commit into from
May 14, 2024
Merged

Conversation

MarshallOfSound
Copy link
Member

@MarshallOfSound MarshallOfSound commented May 14, 2024

Fixes an issue caused by the chain of #40307 and #41750

Fixes #42157

With the new "only run this on non-panels" logic we can restore the exact same old codepath.

Notes: BrowserWindow.focus() now correctly restore focus to inactive apps on macOS

@MarshallOfSound MarshallOfSound added target/30-x-y PR should also be added to the "30-x-y" branch. target/31-x-y PR should also be added to the "31-x-y" branch. labels May 14, 2024
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label May 14, 2024
@MarshallOfSound MarshallOfSound added semver/patch backwards-compatible bug fixes fast-track 🚅 Indicates that this PR is intended to bypass the 24 hour rule. Needs approval from Releases labels May 14, 2024
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label May 14, 2024
@felixrieseberg
Copy link
Member

Fixes #42157

Copy link
Member

@felixrieseberg felixrieseberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I concur, the remaining IsPanel() safety checks should be enough (plus, we have a test for this, so if that passes, we know we'll be okay)

@VerteDinde VerteDinde merged commit 4350035 into main May 14, 2024
26 of 27 checks passed
@VerteDinde VerteDinde deleted the restore-focus-behavior branch May 14, 2024 22:52
Copy link

release-clerk bot commented May 14, 2024

Release Notes Persisted

BrowserWindow.focus() now correctly restore focus to inactive apps on macOS

@trop
Copy link
Contributor

trop bot commented May 14, 2024

I have automatically backported this PR to "31-x-y", please check out #42186

@trop trop bot added in-flight/31-x-y and removed target/31-x-y PR should also be added to the "31-x-y" branch. labels May 14, 2024
@trop
Copy link
Contributor

trop bot commented May 14, 2024

I have automatically backported this PR to "30-x-y", please check out #42187

@trop trop bot added in-flight/30-x-y merged/30-x-y PR was merged to the "30-x-y" branch. merged/31-x-y PR was merged to the "31-x-y" branch. and removed target/30-x-y PR should also be added to the "30-x-y" branch. in-flight/30-x-y in-flight/31-x-y labels May 14, 2024
@jz-notion
Copy link

Thank you for the quick fix! 🙏

MarshallOfSound added a commit that referenced this pull request May 28, 2024
The new activate API on macOS is pretty bad, we should just keep using
the old API. Similar to #42180. Restores non-panel behavior to pre-panel
support.

Notes: BrowserWindow.show() now correctly restores focus to inactive apps on macOS
trop bot added a commit that referenced this pull request May 29, 2024
The new activate API on macOS is pretty bad, we should just keep using
the old API. Similar to #42180. Restores non-panel behavior to pre-panel
support.

Notes: BrowserWindow.show() now correctly restores focus to inactive apps on macOS

Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
trop bot added a commit that referenced this pull request May 29, 2024
The new activate API on macOS is pretty bad, we should just keep using
the old API. Similar to #42180. Restores non-panel behavior to pre-panel
support.

Notes: BrowserWindow.show() now correctly restores focus to inactive apps on macOS

Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
codebytere pushed a commit that referenced this pull request May 29, 2024
The new activate API on macOS is pretty bad, we should just keep using
the old API. Similar to #42180. Restores non-panel behavior to pre-panel
support.

Notes: BrowserWindow.show() now correctly restores focus to inactive apps on macOS

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
VerteDinde pushed a commit that referenced this pull request May 29, 2024
The new activate API on macOS is pretty bad, we should just keep using
the old API. Similar to #42180. Restores non-panel behavior to pre-panel
support.

Notes: BrowserWindow.show() now correctly restores focus to inactive apps on macOS

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fast-track 🚅 Indicates that this PR is intended to bypass the 24 hour rule. Needs approval from Releases merged/30-x-y PR was merged to the "30-x-y" branch. merged/31-x-y PR was merged to the "31-x-y" branch. semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: BrowserWindow#show() does not consistently activate and show window
4 participants