Skip to content

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

Merged
MarshallOfSound merged 2 commits into
electron:masterfrom
shazron:activateIgnoringOtherApps_change
Feb 26, 2019
Merged

MarshallOfSound merged 2 commits into
electron:masterfrom
shazron:activateIgnoringOtherApps_change

Conversation

@shazron

@shazron shazron commented Jan 15, 2019 •

Copy link
Copy Markdown
Contributor

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

welcome Bot commented Jan 15, 2019

Copy link
Copy Markdown

💖 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.

@MarshallOfSound MarshallOfSound left a comment

Copy link
Copy Markdown
Member

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.

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

@shazron can you please rebase this PR?

@shazron

shazron commented Feb 18, 2019

Copy link
Copy Markdown
Contributor Author

@codebytere Rebased.

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

release-clerk Bot commented Feb 26, 2019

Copy link
Copy Markdown

Release Notes Persisted

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

@welcome

welcome Bot commented Feb 26, 2019

Copy link
Copy Markdown

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 done
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.

3 participants