node-mac-recorder 2.10.13 → 2.10.14

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.10.13",
3
+ "version": "2.10.14",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -509,10 +509,25 @@ void updateOverlay() {
509
509
  [NSPredicate predicateWithFormat:@"id == %d", toggledWindowId]] firstObject] : nil;
510
510
 
511
511
  if (freshWindowData && ![freshWindowData isEqualToDictionary:g_currentWindowUnderCursor]) {
512
- // Toggled window position changed - update
513
- needsUpdate = YES;
514
- targetWindow = freshWindowData;
515
- NSLog(@"📍 TOGGLED WINDOW MOVED: Updating overlay position");
512
+ // Check if position change is significant enough to update
513
+ int oldX = [[g_currentWindowUnderCursor objectForKey:@"x"] intValue];
514
+ int oldY = [[g_currentWindowUnderCursor objectForKey:@"y"] intValue];
515
+ int newX = [[freshWindowData objectForKey:@"x"] intValue];
516
+ int newY = [[freshWindowData objectForKey:@"y"] intValue];
517
+
518
+ int deltaX = abs(newX - oldX);
519
+ int deltaY = abs(newY - oldY);
520
+
521
+ if (deltaX >= 3 || deltaY >= 3) {
522
+ // Significant position change - update
523
+ needsUpdate = YES;
524
+ targetWindow = freshWindowData;
525
+ NSLog(@"📍 TOGGLED WINDOW MOVED: (%d,%d) → (%d,%d)", oldX, oldY, newX, newY);
526
+ } else {
527
+ // Minor change - ignore to prevent flickering
528
+ needsUpdate = NO;
529
+ targetWindow = g_currentWindowUnderCursor;
530
+ }
516
531
  } else {
517
532
  // No change needed for toggled window
518
533
  needsUpdate = NO;
@@ -538,10 +553,25 @@ void updateOverlay() {
538
553
  [NSPredicate predicateWithFormat:@"id == %d", currentWindowId]] firstObject] : nil;
539
554
 
540
555
  if (freshWindowData && ![freshWindowData isEqualToDictionary:g_currentWindowUnderCursor]) {
541
- // Same window but position/size changed
542
- needsUpdate = YES;
543
- targetWindow = freshWindowData;
544
- NSLog(@"📍 WINDOW MOVED: Updating overlay position");
556
+ // Check if position change is significant enough to update
557
+ int oldX = [[g_currentWindowUnderCursor objectForKey:@"x"] intValue];
558
+ int oldY = [[g_currentWindowUnderCursor objectForKey:@"y"] intValue];
559
+ int newX = [[freshWindowData objectForKey:@"x"] intValue];
560
+ int newY = [[freshWindowData objectForKey:@"y"] intValue];
561
+
562
+ int deltaX = abs(newX - oldX);
563
+ int deltaY = abs(newY - oldY);
564
+
565
+ if (deltaX >= 3 || deltaY >= 3) {
566
+ // Significant position change - update
567
+ needsUpdate = YES;
568
+ targetWindow = freshWindowData;
569
+ NSLog(@"📍 WINDOW MOVED: (%d,%d) → (%d,%d)", oldX, oldY, newX, newY);
570
+ } else {
571
+ // Minor change - ignore to prevent flickering
572
+ needsUpdate = NO;
573
+ targetWindow = g_currentWindowUnderCursor;
574
+ }
545
575
  } else {
546
576
  targetWindow = g_currentWindowUnderCursor;
547
577
  }