[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: RFR: 8231513: JavaFX cause Keystroke Receiving prompt on MacOS 10.15 (Catalina)
From:       Kevin Rushforth <kcr () openjdk ! java ! net>
Date:       2020-01-31 14:36:31
Message-ID: iwq84WXUS8dZuqD39RR2Ple1OUKgX8741CNKhfnhhMg=.833961b7-0aff-46bd-97ad-ed5be2cab7c4 () github ! com
[Download RAW message or body]

On Fri, 31 Jan 2020 09:17:59 GMT, Johan Vos <jvos@openjdk.org> wrote:

> > This is a fix for [JDK-8231513](https://bugs.openjdk.java.net/browse/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](https://mail.openjdk.java.net/pipermail/openjfx-dev/2020-January/024876.html) \
> > on openjfx-dev for more discussion.
> 
> modules/javafx.graphics/src/main/native-glass/mac/GlassTouches.m line 179:
> 
> > 178: {
> > 179:     BOOL useEventTap = YES;
> > 180:     if (@available(macOS 10.15, *)) {
> 
> I think that if you make useEventTap static, you don't need the additional tests in \
> the other functions. init is always the first one to be called.

OK, I'll push an update for this.

-------------

PR: https://git.openjdk.java.net/jfx/pull/102


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic