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

Conversation

@shazron
Copy link
Contributor

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 as a code owner Jan 15, 2019

@welcome

This comment has been minimized.

Copy link

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.

@sindresorhus

This comment has been minimized.

Copy link
Contributor

commented Jan 15, 2019

@MarshallOfSound
Copy link
Member

left a comment

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];

This comment has been minimized.

Copy link
@MarshallOfSound

MarshallOfSound Jan 15, 2019

Member

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

This comment has been minimized.

Copy link
@shazron

shazron Jan 17, 2019

Author Contributor

Reverted the change.

@codebytere

This comment has been minimized.

Copy link
Member

commented Feb 15, 2019

@shazron can you please rebase this PR?

@shazron shazron force-pushed the shazron:activateIgnoringOtherApps_change branch from 9de05b3 to 3200a31 Feb 18, 2019

@shazron

This comment has been minimized.

Copy link
Contributor Author

commented Feb 18, 2019

@codebytere Rebased.

@MarshallOfSound MarshallOfSound merged commit 6da9396 into electron:master Feb 26, 2019

7 of 9 checks passed

Artifact Comparison Digging Failed
Details
build-linux Workflow: build-linux
Details
Semantic Pull Request ready to be squashed
Details
WIP Ready for review
Details
appveyor: win-ia32-testing-pr AppVeyor build succeeded
Details
appveyor: win-x64-testing-pr AppVeyor build succeeded
Details
build-mac Workflow: build-mac
Details
lint Workflow: lint
Details
release-notes Release notes found
@release-clerk

This comment has been minimized.

Copy link

commented Feb 26, 2019

Release Notes Persisted

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

@welcome

This comment has been minimized.

Copy link

commented Feb 26, 2019

Congrats on merging your first pull request! 🎉🎉🎉

@shazron shazron deleted the shazron:activateIgnoringOtherApps_change branch Mar 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.