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: respect the user's active app focus #16400

Merged
merged 2 commits into from Feb 26, 2019
Merged

fix: respect the user's active app focus #16400

merged 2 commits into from Feb 26, 2019

Conversation

shazron
Copy link
Contributor

@shazron shazron commented Jan 15, 2019

Apple recommends not setting this to true, and this behaviour is non-standard (not to mention annoying when someone is actively focused on another app, like writing) https://developer.apple.com/documentation/appkit/nsapplication/1428468-activateignoringotherapps?language=objc

cc @zcbenz

Description of Change

Checklist

Release Notes

Notes: Focus methods no longer steal focus when users are active on other apps

@shazron shazron requested a review from a team January 15, 2019 05:42
@welcome
Copy link

welcome bot commented Jan 15, 2019

💖 Thanks for opening this pull request! 💖

We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix.

Examples of commit messages with semantic prefixes:

  • fix: don't overwrite prevent_default if default wasn't prevented
  • feat: add app.isPackaged() method
  • docs: app.isDefaultProtocolClient is now available on Linux

Things that will help get your PR across the finish line:

  • Follow the JavaScript, C++, and Python coding style.
  • Run npm run lint locally to catch formatting errors earlier.
  • Document any user-facing changes you've made following the documentation styleguide.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

Copy link
Member

@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

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

One of these (the bundle mover) we definitely can't change.

The other two we probably can but I'd have to check the history of those impls. Tentative approval pending a check of the superview logic.

@@ -48,7 +48,7 @@
// Activate app -- work-around for focus issues related to "scary file from
// internet" OS dialog.
if (![NSApp isActive]) {
[NSApp activateIgnoringOtherApps:true];
Copy link
Member

Choose a reason for hiding this comment

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

This will break the bundle mover, can we not make this change here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted the change.

@codebytere
Copy link
Member

@shazron can you please rebase this PR?

@shazron
Copy link
Contributor Author

shazron commented Feb 18, 2019

@codebytere Rebased.

@MarshallOfSound MarshallOfSound merged commit 6da9396 into electron:master Feb 26, 2019
@release-clerk
Copy link

release-clerk bot commented Feb 26, 2019

Release Notes Persisted

Focus methods no longer steal focus when users are active on other apps

@welcome
Copy link

welcome bot commented Feb 26, 2019

Congrats on merging your first pull request! 🎉🎉🎉

@shazron shazron deleted the activateIgnoringOtherApps_change branch March 27, 2019 03:41
@codebytere codebytere mentioned this pull request Mar 6, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants