node-mac-recorder 2.20.5 → 2.20.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-mac-recorder",
3
- "version": "2.20.5",
3
+ "version": "2.20.7",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -106,7 +106,7 @@ static BOOL CopyAttributeBoolean(AXUIElementRef element, CFStringRef attribute,
106
106
  return YES;
107
107
  }
108
108
 
109
- static BOOL ElementHasAction(AXUIElementRef element, CFStringRef action) {
109
+ static __attribute__((unused)) BOOL ElementHasAction(AXUIElementRef element, CFStringRef action) {
110
110
  if (!element || !action) {
111
111
  return NO;
112
112
  }
@@ -563,9 +563,7 @@ NSString* getCursorType() {
563
563
  @autoreleasepool {
564
564
  g_cursorTypeCounter++;
565
565
 
566
- NSString *systemCursorType = detectSystemCursorType();
567
-
568
- NSString *axCursorType = nil;
566
+ // Hybrid: AX (strict) first, then system cursor fallback.
569
567
  BOOL hasCursorPosition = NO;
570
568
  CGPoint cursorPos = CGPointZero;
571
569
 
@@ -590,15 +588,17 @@ NSString* getCursorType() {
590
588
  }
591
589
  }
592
590
 
591
+ NSString *axCursorType = nil;
593
592
  if (hasCursorPosition) {
594
593
  axCursorType = detectCursorTypeUsingAccessibility(cursorPos);
595
594
  }
596
595
 
596
+ NSString *systemCursorType = detectSystemCursorType();
597
+
597
598
  NSString *finalType = nil;
598
599
  if (axCursorType && ![axCursorType isEqualToString:@"default"]) {
599
600
  finalType = axCursorType;
600
601
  } else if (systemCursorType && [systemCursorType length] > 0) {
601
- // Prefer the system cursor when accessibility reports a generic value.
602
602
  finalType = systemCursorType;
603
603
  } else if (axCursorType && [axCursorType length] > 0) {
604
604
  finalType = axCursorType;
@@ -662,9 +662,6 @@ CGEventRef eventCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef eve
662
662
  NSTimeInterval timestamp = [currentDate timeIntervalSinceDate:g_trackingStartTime] * 1000; // milliseconds
663
663
  NSTimeInterval unixTimeMs = [currentDate timeIntervalSince1970] * 1000; // unix timestamp in milliseconds
664
664
  NSString *cursorType = getCursorType();
665
- // Debug fields: capture raw AX and system cursor types
666
- NSString *axTypeDbg = detectCursorTypeUsingAccessibility(location);
667
- NSString *sysTypeDbg = detectSystemCursorType();
668
665
  // (already captured above)
669
666
  NSString *eventType = @"move";
670
667
 
@@ -698,9 +695,7 @@ CGEventRef eventCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef eve
698
695
  @"timestamp": @(timestamp),
699
696
  @"unixTimeMs": @(unixTimeMs),
700
697
  @"cursorType": cursorType,
701
- @"type": eventType,
702
- @"axCursorType": axTypeDbg ? axTypeDbg : @"",
703
- @"systemCursorType": sysTypeDbg ? sysTypeDbg : @""
698
+ @"type": eventType
704
699
  };
705
700
 
706
701
  // Direkt dosyaya yaz
@@ -733,9 +728,6 @@ void cursorTimerCallback() {
733
728
  NSTimeInterval timestamp = [currentDate timeIntervalSinceDate:g_trackingStartTime] * 1000; // milliseconds
734
729
  NSTimeInterval unixTimeMs = [currentDate timeIntervalSince1970] * 1000; // unix timestamp in milliseconds
735
730
  NSString *cursorType = getCursorType();
736
- // Debug fields: capture raw AX and system cursor types
737
- NSString *axTypeDbg = detectCursorTypeUsingAccessibility(location);
738
- NSString *sysTypeDbg = detectSystemCursorType();
739
731
 
740
732
  // Cursor data oluştur
741
733
  NSDictionary *cursorInfo = @{
@@ -744,9 +736,7 @@ void cursorTimerCallback() {
744
736
  @"timestamp": @(timestamp),
745
737
  @"unixTimeMs": @(unixTimeMs),
746
738
  @"cursorType": cursorType,
747
- @"type": @"move",
748
- @"axCursorType": axTypeDbg ? axTypeDbg : @"",
749
- @"systemCursorType": sysTypeDbg ? sysTypeDbg : @""
739
+ @"type": @"move"
750
740
  };
751
741
 
752
742
  // Direkt dosyaya yaz