< prev index next >

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

Print this page
@@ -40,10 +40,11 @@
      #define LOG(MSG, ...) GLASS_LOG(MSG, ## __VA_ARGS__);
  #endif
  
  
  static GlassTouches* glassTouches = nil;
+ static BOOL useEventTap = NO;
  
  
  @interface GlassTouches (hidden)
  
  - (void)releaseTouches;

@@ -174,11 +175,11 @@
      glassTouches = nil;
  }
  
  - (id)init
  {
-     BOOL useEventTap = YES;
+     useEventTap = YES;
      if (@available(macOS 10.15, *)) {
          useEventTap = NO;
      }
  
      self = [super init];

@@ -230,15 +231,10 @@
  
  
  @implementation GlassTouches (hidden)
  - (void)terminateImpl
  {
-     BOOL useEventTap = YES;
-     if (@available(macOS 10.15, *)) {
-         useEventTap = NO;
-     }
- 
      if (useEventTap) {
          LOG("TOUCHES: terminateImpl eventTap=%p runLoopSource=%p\n", self->eventTap,
              self->runLoopSource);
  
          if (self->runLoopSource)

@@ -258,15 +254,10 @@
      [self releaseTouches];
  }
  
  - (void)enableTouchInputEventTap
  {
-     BOOL useEventTap = YES;
-     if (@available(macOS 10.15, *)) {
-         useEventTap = NO;
-     }
- 
      if (useEventTap) {
          CGEventTapEnable(self->eventTap, true);
      }
  }
  
< prev index next >