node-mac-recorder 2.10.12 → 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 +1 -1
- package/src/window_selector.mm +47 -22
package/package.json
CHANGED
package/src/window_selector.mm
CHANGED
|
@@ -501,33 +501,43 @@ void updateOverlay() {
|
|
|
501
501
|
if (windowUnderCursor) {
|
|
502
502
|
// Check if we're in lock mode (toggled window)
|
|
503
503
|
if (g_hasToggledWindow && g_currentWindowUnderCursor) {
|
|
504
|
-
//
|
|
504
|
+
// In lock mode - only track toggled window position, ignore cursor
|
|
505
505
|
int toggledWindowId = [[g_currentWindowUnderCursor objectForKey:@"id"] intValue];
|
|
506
|
-
|
|
506
|
+
NSArray *allWindows = getAllSelectableWindows();
|
|
507
|
+
NSDictionary *freshWindowData = allWindows ?
|
|
508
|
+
[[allWindows filteredArrayUsingPredicate:
|
|
509
|
+
[NSPredicate predicateWithFormat:@"id == %d", toggledWindowId]] firstObject] : nil;
|
|
507
510
|
|
|
508
|
-
if (
|
|
509
|
-
//
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
NSDictionary *freshWindowData = allWindows ?
|
|
518
|
-
[[allWindows filteredArrayUsingPredicate:
|
|
519
|
-
[NSPredicate predicateWithFormat:@"id == %d", toggledWindowId]] firstObject] : nil;
|
|
511
|
+
if (freshWindowData && ![freshWindowData isEqualToDictionary:g_currentWindowUnderCursor]) {
|
|
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
520
|
|
|
521
|
-
if (
|
|
522
|
-
//
|
|
521
|
+
if (deltaX >= 3 || deltaY >= 3) {
|
|
522
|
+
// Significant position change - update
|
|
523
523
|
needsUpdate = YES;
|
|
524
524
|
targetWindow = freshWindowData;
|
|
525
|
-
NSLog(@"📍 TOGGLED WINDOW MOVED:
|
|
525
|
+
NSLog(@"📍 TOGGLED WINDOW MOVED: (%d,%d) → (%d,%d)", oldX, oldY, newX, newY);
|
|
526
526
|
} else {
|
|
527
|
-
//
|
|
527
|
+
// Minor change - ignore to prevent flickering
|
|
528
528
|
needsUpdate = NO;
|
|
529
529
|
targetWindow = g_currentWindowUnderCursor;
|
|
530
530
|
}
|
|
531
|
+
} else {
|
|
532
|
+
// No change needed for toggled window
|
|
533
|
+
needsUpdate = NO;
|
|
534
|
+
targetWindow = g_currentWindowUnderCursor;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
// Log cursor movement but don't act on it
|
|
538
|
+
int cursorWindowId = [[windowUnderCursor objectForKey:@"id"] intValue];
|
|
539
|
+
if (toggledWindowId != cursorWindowId) {
|
|
540
|
+
NSLog(@"🔒 LOCK ACTIVE: Cursor on different window but keeping toggle");
|
|
531
541
|
}
|
|
532
542
|
} else if (!g_currentWindowUnderCursor ||
|
|
533
543
|
![windowUnderCursor isEqualToDictionary:g_currentWindowUnderCursor]) {
|
|
@@ -543,10 +553,25 @@ void updateOverlay() {
|
|
|
543
553
|
[NSPredicate predicateWithFormat:@"id == %d", currentWindowId]] firstObject] : nil;
|
|
544
554
|
|
|
545
555
|
if (freshWindowData && ![freshWindowData isEqualToDictionary:g_currentWindowUnderCursor]) {
|
|
546
|
-
//
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
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
|
+
}
|
|
550
575
|
} else {
|
|
551
576
|
targetWindow = g_currentWindowUnderCursor;
|
|
552
577
|
}
|