node-mac-recorder 2.10.11 → 2.10.12
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 +41 -4
package/package.json
CHANGED
package/src/window_selector.mm
CHANGED
|
@@ -499,9 +499,39 @@ void updateOverlay() {
|
|
|
499
499
|
NSDictionary *targetWindow = nil;
|
|
500
500
|
|
|
501
501
|
if (windowUnderCursor) {
|
|
502
|
-
if (
|
|
502
|
+
// Check if we're in lock mode (toggled window)
|
|
503
|
+
if (g_hasToggledWindow && g_currentWindowUnderCursor) {
|
|
504
|
+
// Check if cursor moved to different window while locked
|
|
505
|
+
int toggledWindowId = [[g_currentWindowUnderCursor objectForKey:@"id"] intValue];
|
|
506
|
+
int cursorWindowId = [[windowUnderCursor objectForKey:@"id"] intValue];
|
|
507
|
+
|
|
508
|
+
if (toggledWindowId != cursorWindowId) {
|
|
509
|
+
// Cursor moved to different window - cancel toggle and switch to new window
|
|
510
|
+
NSLog(@"🔓 TOGGLE CANCELLED: Cursor moved to different window");
|
|
511
|
+
g_hasToggledWindow = NO;
|
|
512
|
+
needsUpdate = YES;
|
|
513
|
+
targetWindow = windowUnderCursor;
|
|
514
|
+
} else {
|
|
515
|
+
// Same window - check for position changes
|
|
516
|
+
NSArray *allWindows = getAllSelectableWindows();
|
|
517
|
+
NSDictionary *freshWindowData = allWindows ?
|
|
518
|
+
[[allWindows filteredArrayUsingPredicate:
|
|
519
|
+
[NSPredicate predicateWithFormat:@"id == %d", toggledWindowId]] firstObject] : nil;
|
|
520
|
+
|
|
521
|
+
if (freshWindowData && ![freshWindowData isEqualToDictionary:g_currentWindowUnderCursor]) {
|
|
522
|
+
// Toggled window position changed - update
|
|
523
|
+
needsUpdate = YES;
|
|
524
|
+
targetWindow = freshWindowData;
|
|
525
|
+
NSLog(@"📍 TOGGLED WINDOW MOVED: Updating overlay position");
|
|
526
|
+
} else {
|
|
527
|
+
// No change needed
|
|
528
|
+
needsUpdate = NO;
|
|
529
|
+
targetWindow = g_currentWindowUnderCursor;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
} else if (!g_currentWindowUnderCursor ||
|
|
503
533
|
![windowUnderCursor isEqualToDictionary:g_currentWindowUnderCursor]) {
|
|
504
|
-
//
|
|
534
|
+
// Normal mode - new window under cursor
|
|
505
535
|
needsUpdate = YES;
|
|
506
536
|
targetWindow = windowUnderCursor;
|
|
507
537
|
} else {
|
|
@@ -592,9 +622,16 @@ void updateOverlay() {
|
|
|
592
622
|
// Ensure overlay is on the correct screen
|
|
593
623
|
[g_overlayWindow setFrame:overlayFrame display:YES];
|
|
594
624
|
|
|
595
|
-
// Update overlay view window info
|
|
625
|
+
// Update overlay view window info
|
|
596
626
|
[(WindowSelectorOverlayView *)g_overlayView setWindowInfo:targetWindow];
|
|
597
|
-
|
|
627
|
+
|
|
628
|
+
// Only reset toggle state when switching to different window (not for position updates)
|
|
629
|
+
if (!g_hasToggledWindow) {
|
|
630
|
+
[(WindowSelectorOverlayView *)g_overlayView setIsToggled:NO];
|
|
631
|
+
} else {
|
|
632
|
+
// Keep toggle state for locked window
|
|
633
|
+
[(WindowSelectorOverlayView *)g_overlayView setIsToggled:YES];
|
|
634
|
+
}
|
|
598
635
|
|
|
599
636
|
// Add/update info label above button
|
|
600
637
|
NSTextField *infoLabel = nil;
|