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: don't register some shortcuts without accessibility #16125

Merged
merged 6 commits into from Jan 4, 2019

Conversation

@codebytere
Copy link
Member

codebytere commented Dec 18, 2018

Description of Change

Resolves #14837.

/cc @ckerr

Checklist

  • PR description included and stakeholders cc'd
  • npm test passes
  • relevant documentation is changed or added
  • PR title follows semantic commit guidelines
  • PR release notes describe the change in a way relevant to app-developers

Release Notes

Notes: Fixed crash on macOS when using globalShortcut for media keys when accessibility access is not granted.

@codebytere codebytere requested a review from Dec 18, 2018
@4ndv

This comment has been minimized.

Copy link

4ndv commented Dec 19, 2018

  1. AFAIK it required only since Mojave on macOS
  2. Crashes occur on unregister, maybe checks also should be there?
@codebytere

This comment has been minimized.

Copy link
Member Author

codebytere commented Dec 19, 2018

@4ndv the crash occurs on unregister because the shortcuts are falsely registered from what i could tell, meaning that the simplest way to prevent that would be to ensure that no globalShortcuts are registered with incorrect accessibility permissions

@codebytere codebytere changed the title [WIP] fix: don't register some shortcuts without accessibility [wip] fix: don't register some shortcuts without accessibility Dec 22, 2018
@codebytere codebytere force-pushed the fix-globalshortcut-crash branch from 3f01165 to 3940e37 Jan 2, 2019
@codebytere codebytere changed the title [wip] fix: don't register some shortcuts without accessibility fix: don't register some shortcuts without accessibility Jan 2, 2019
@codebytere codebytere changed the title fix: don't register some shortcuts without accessibility fix: don't register some shortcuts without accessibility Jan 2, 2019
atom/browser/api/atom_api_global_shortcut.cc Outdated Show resolved Hide resolved
atom/browser/api/atom_api_global_shortcut.cc Outdated Show resolved Hide resolved
atom/browser/api/atom_api_global_shortcut.cc Outdated Show resolved Hide resolved
Copy link
Member

nornagon left a comment

Add a note about macOS-only to release notes.

@codebytere codebytere requested a review from Jan 2, 2019
@codebytere codebytere force-pushed the fix-globalshortcut-crash branch from 0398d20 to 9705298 Jan 2, 2019
@miniak
miniak approved these changes Jan 3, 2019
Copy link
Member

BinaryMuse left a comment

Minor typos below, but otherwise approving on behalf of docs.

It could be nice to link to a document when we mentioned being "authorized as a trusted accessibility client" in case folks don't know what that means or how to do it.

docs/api/global-shortcut.md Outdated Show resolved Hide resolved
docs/api/global-shortcut.md Outdated Show resolved Hide resolved
codebytere added 6 commits Jan 2, 2019
@codebytere codebytere force-pushed the fix-globalshortcut-crash branch from aaceb1f to 35c76aa Jan 4, 2019
@codebytere codebytere merged commit 8760640 into master Jan 4, 2019
25 of 27 checks passed
25 of 27 checks passed
electron-arm-testing Build #20190104.2 has failed
Details
electron-mas-testing Build #20190104.2 has test failures
Details
Artifact Comparison Changes Detected
Details
Absolute Zero
Semantic Pull Request ready to be squashed
Details
WIP ready for review
Details
appveyor: win-ia32-debug AppVeyor build succeeded
Details
appveyor: win-ia32-testing AppVeyor build succeeded
Details
appveyor: win-ia32-testing-pr AppVeyor build succeeded
Details
appveyor: win-x64-debug AppVeyor build succeeded
Details
appveyor: win-x64-testing AppVeyor build succeeded
Details
appveyor: win-x64-testing-pr AppVeyor build succeeded
Details
ci/circleci: linux-arm-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-arm-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-arm64-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-arm64-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-checkout Your tests passed on CircleCI!
Details
ci/circleci: linux-ia32-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-ia32-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-ia32-testing-tests Your tests passed on CircleCI!
Details
ci/circleci: linux-x64-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-x64-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-x64-testing-tests Your tests passed on CircleCI!
Details
electron-arm64-testing Build #20190104.2 succeeded
Details
electron-lint Build #20190104.2 succeeded
Details
electron-osx-testing Build #20190104.7 succeeded
Details
release-notes Release notes found
@release-clerk

This comment has been minimized.

Copy link

release-clerk bot commented Jan 4, 2019

Release Notes Persisted

Fixed crash on macOS when using globalShortcut for media keys when accessibility access is not granted.

@codebytere codebytere deleted the fix-globalshortcut-crash branch Jan 4, 2019
@codebytere

This comment has been minimized.

Copy link
Member Author

codebytere commented Jan 4, 2019

/trop run backport-to 4-0-x,3-1-x,3-0-x

@trop

This comment has been minimized.

Copy link
Contributor

trop bot commented Jan 4, 2019

The backport process for this PR has been manually initiated,
sending your 1's and 0's to "4-0-x" here we go! :D

@trop

This comment has been minimized.

Copy link
Contributor

trop bot commented Jan 4, 2019

The backport process for this PR has been manually initiated,
sending your 1's and 0's to "3-1-x" here we go! :D

@trop

This comment has been minimized.

Copy link
Contributor

trop bot commented Jan 4, 2019

The backport process for this PR has been manually initiated,
sending your 1's and 0's to "3-0-x" here we go! :D

@trop

This comment has been minimized.

Copy link
Contributor

trop bot commented Jan 4, 2019

I was unable to backport this PR to "4-0-x" cleanly;
you will need to perform this backport manually.

@trop

This comment has been minimized.

Copy link
Contributor

trop bot commented Jan 4, 2019

I was unable to backport this PR to "3-1-x" cleanly;
you will need to perform this backport manually.

@trop

This comment has been minimized.

Copy link
Contributor

trop bot commented Jan 4, 2019

I was unable to backport this PR to "3-0-x" cleanly;
you will need to perform this backport manually.

akisctx added a commit to akisctx/electron that referenced this pull request Jan 22, 2019
)

Fixed crash on macOS when using globalShortcut for media keys when accessibility access is not granted.
poiru added a commit to poiru/electron that referenced this pull request Nov 5, 2019
This was a regression in electron#16125, which unintentionally put
`GlobalShortcutListener::RegisterAccelerator` into a
`#if defined(OS_MACOSX)` block.

Notes: Fix broken `globalShortcut.registerAll()` on Windows and Linux
MarshallOfSound added a commit that referenced this pull request Nov 5, 2019
…20963)

This was a regression in #16125, which unintentionally put
`GlobalShortcutListener::RegisterAccelerator` into a
`#if defined(OS_MACOSX)` block.

Notes: Fix broken `globalShortcut.registerAll()` on Windows and Linux
trop bot pushed a commit that referenced this pull request Nov 5, 2019
This was a regression in #16125, which unintentionally put
`GlobalShortcutListener::RegisterAccelerator` into a
`#if defined(OS_MACOSX)` block.

Notes: Fix broken `globalShortcut.registerAll()` on Windows and Linux
trop bot pushed a commit that referenced this pull request Nov 5, 2019
This was a regression in #16125, which unintentionally put
`GlobalShortcutListener::RegisterAccelerator` into a
`#if defined(OS_MACOSX)` block.

Notes: Fix broken `globalShortcut.registerAll()` on Windows and Linux
trop bot pushed a commit that referenced this pull request Nov 5, 2019
This was a regression in #16125, which unintentionally put
`GlobalShortcutListener::RegisterAccelerator` into a
`#if defined(OS_MACOSX)` block.

Notes: Fix broken `globalShortcut.registerAll()` on Windows and Linux
codebytere added a commit that referenced this pull request Nov 6, 2019
…20983)

This was a regression in #16125, which unintentionally put
`GlobalShortcutListener::RegisterAccelerator` into a
`#if defined(OS_MACOSX)` block.

Notes: Fix broken `globalShortcut.registerAll()` on Windows and Linux
codebytere added a commit that referenced this pull request Nov 6, 2019
…20982)

This was a regression in #16125, which unintentionally put
`GlobalShortcutListener::RegisterAccelerator` into a
`#if defined(OS_MACOSX)` block.

Notes: Fix broken `globalShortcut.registerAll()` on Windows and Linux
codebytere added a commit that referenced this pull request Nov 7, 2019
…20984)

This was a regression in #16125, which unintentionally put
`GlobalShortcutListener::RegisterAccelerator` into a
`#if defined(OS_MACOSX)` block.

Notes: Fix broken `globalShortcut.registerAll()` on Windows and Linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.