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

8231513: JavaFX cause Keystroke Receiving prompt on MacOS 10.15 (Catalina) #102

Closed

Conversation

kevinrushforth
Copy link
Member

@kevinrushforth kevinrushforth commented Jan 30, 2020

This is a fix for JDK-8231513 to disable the use of CGEventTap when running on macOS 10.15 or later.

The effect of this bug is that a scary dialog is shown for all users the first time they run a JavaFX application and move the mouse is moved into the JavaFX window. It also is reported to block apps from being accepted in the Apple store.

This bug is caused by a change in macOS 10.15 to require additional permissions for using CGEventTap, which JavaFX uses to track touch events.

The suggested replacement API, NSEvent::addLocalMonitorForEventsMatchingMask, works just differently enough (it tracks events delivered to a specific view, whereas the current code is implemented using a global monitor and a global set of touch points), that it would be too risky to change it this late in the release.

For openjfx14, I am proposing to disable touch events completely if running on macOS 10.15 (or later). This will disable the tracking of native touch events, but those events are not used by default on macOS anyway. For Mac systems with a trackpad we instead rely on macOS to do the gesture recognition by default, and this fix does not intefere with that functionality.

I have verified that this avoids the dialog on macOS 10.15 and that the HelloGestures program still runs correctly and still recognizes trackpad gestures such as zoom and rotate. I also verified that the changes don't affect macOS 10.14 or earlier (the Event Tap code is still enabled on those older OS versions).

See this thread on openjfx-dev for more discussion.

Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

JDK-8231513: JavaFX cause Keystroke Receiving prompt on MacOS 10.15 (Catalina)

Approvers

  • Phil Race (prr - Reviewer) Note! Review applies to d6109fb
  • Johan Vos (jvos - Reviewer)

@kevinrushforth kevinrushforth self-assigned this Jan 30, 2020
@bridgekeeper
Copy link

bridgekeeper bot commented Jan 30, 2020

👋 Welcome back kcr! A progress list of the required criteria for merging this PR into jfx14 will be added to the body of your pull request.

@openjdk openjdk bot added the rfr Ready for review label Jan 30, 2020
@kevinrushforth
Copy link
Member Author

/reviewers 2

@openjdk
Copy link

openjdk bot commented Jan 30, 2020

@kevinrushforth
The number of required reviews for this PR is now set to 2 (with at least 1 of role reviewers).

@kevinrushforth
Copy link
Member Author

@arapte can you be one of the reviewers?

Copy link
Collaborator

@prrace prrace left a comment

Choose a reason for hiding this comment

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

Looks OK to me.

@mlbridge
Copy link

mlbridge bot commented Jan 31, 2020

Webrevs

@kevinrushforth
Copy link
Member Author

Pushed a fix to address the review comments.

@rwestberg for some reason the above commit didn't send an RFR reply to openjfx-dev nor did it produce a new webrev (it did rerun jcheck as expected).

@openjdk
Copy link

openjdk bot commented Feb 1, 2020

@kevinrushforth This change now passes all automated pre-integration checks. When the change also fulfills all project specific requirements, type /integrate in a new comment to proceed. After integration, the commit message will be:

8231513: JavaFX cause Keystroke Receiving prompt on MacOS 10.15 (Catalina)

Reviewed-by: prr, jvos
  • If you would like to add a summary, use the /summary command.
  • To credit additional contributors, use the /contributor command.
  • To add additional solved issues, use the /solves command.

Since the source branch of this PR was last updated there has been 1 commit pushed to the jfx14 branch. Since there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid automatic rebasing, please merge jfx14 into your branch, and then specify the current head hash when integrating, like this: /integrate 1823f6ececf7bb5ee0362477c9c7524f6596f794.

➡️ To integrate this PR with the above commit message, type /integrate in a new comment.

@openjdk openjdk bot added the ready Ready to be integrated label Feb 1, 2020
@kevinrushforth
Copy link
Member Author

/integrate

@openjdk openjdk bot closed this Feb 1, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Ready to be integrated labels Feb 1, 2020
@openjdk
Copy link

openjdk bot commented Feb 1, 2020

@kevinrushforth The following commits have been pushed to jfx14 since your change was applied:

  • 1823f6e: 8088198: Exception thrown from snapshot if dimensions are larger than max texture size

Your commit was automatically rebased without conflicts.

Pushed as commit 2ab40c1.

@openjdk openjdk bot removed the rfr Ready for review label Feb 1, 2020
@mlbridge
Copy link

mlbridge bot commented Feb 2, 2020

Mailing list message from Kevin Rushforth on openjfx-dev:

Changeset: 2ab40c1
Author: Kevin Rushforth <kcr at openjdk.org>
Date: 2020-02-01 14:35:47 +0000
URL: https://git.openjdk.java.net/jfx/commit/2ab40c1c

8231513: JavaFX cause Keystroke Receiving prompt on MacOS 10.15 (Catalina)

Reviewed-by: prr, jvos

! modules/javafx.graphics/src/main/native-glass/mac/GlassTouches.m

@kevinrushforth kevinrushforth deleted the 8231513-macos-key-prompt branch February 3, 2020 13:16
@mlbridge
Copy link

mlbridge bot commented Feb 3, 2020

Mailing list message from Kevin Rushforth on openjfx-dev:

Changeset: 2ab40c1
Author: Kevin Rushforth <kcr at openjdk.org>
Date: 2020-02-01 14:35:47 +0000
URL: https://git.openjdk.java.net/jfx/commit/2ab40c1c

8231513: JavaFX cause Keystroke Receiving prompt on MacOS 10.15 (Catalina)

Reviewed-by: prr, jvos

! modules/javafx.graphics/src/main/native-glass/mac/GlassTouches.m

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
3 participants