Rule Request: Disallow NSApp.activate(ignoringOtherApps: true)
in applicationDidFinishLaunching
#2643
Open
2 tasks done
Labels
New Issue Checklist
New rule request
Most macOS apps abuse this method. The problem is the
ignoringOtherApps: true
part. It means if you launch the app and then switch to a different app while it's launching, it will steal focus when it has finished launching. This is something that is hard to catch in development, but users gets annoyed by this behavior.I propose reporting when
NSApp.activate(ignoringOtherApps: true)
is used insideapplicationDidFinishLaunching
. It's ok to useignoringOtherApps: true
in other situations. It's also ok to useNSApp.activate(ignoringOtherApps: false)
insideapplicationDidFinishLaunching
.Having this rule will hopefully make devs aware they're using the API incorrectly and fix their apps.
Because it's a widespread problem that affects real users: https://twitter.com/sindresorhus/status/1085002325511426051
Would trigger:
Would not trigger:
No.
Enabled by default.
The text was updated successfully, but these errors were encountered: