node-mac-recorder 2.8.3 → 2.9.0

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.8.3",
3
+ "version": "2.9.0",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -17,7 +17,8 @@ static NSView *g_overlayView = nil;
17
17
  static WindowSelectorOverlayView *g_selectedOverlayView = nil; // Track selected overlay
18
18
  static NSButton *g_selectButton = nil;
19
19
  static NSTimer *g_trackingTimer = nil;
20
- static NSDictionary *g_selectedWindowInfo = nil;
20
+ static NSDictionary *g_selectedWindowInfo = nil; // Window info for recording
21
+ static NSDictionary *g_clickedWindowInfo = nil; // Separate state for clicked selection (NOT for recording)
21
22
  static NSMutableArray *g_allWindows = nil;
22
23
  static NSDictionary *g_currentWindowUnderCursor = nil;
23
24
  static bool g_bringToFrontEnabled = true; // Default enabled
@@ -133,10 +134,10 @@ void updateScreenOverlays();
133
134
  // Deselect this window - return to normal highlight behavior
134
135
  self.isSelectedWindow = NO;
135
136
 
136
- // Clear global selection
137
- if (g_selectedWindowInfo) {
138
- [g_selectedWindowInfo release];
139
- g_selectedWindowInfo = nil;
137
+ // Clear global clicked selection (NOT recording selection)
138
+ if (g_clickedWindowInfo) {
139
+ [g_clickedWindowInfo release];
140
+ g_clickedWindowInfo = nil;
140
141
  }
141
142
  g_selectedOverlayView = nil;
142
143
 
@@ -150,19 +151,19 @@ void updateScreenOverlays();
150
151
  [g_selectedOverlayView updateAppearance];
151
152
  }
152
153
 
153
- // Select this window
154
+ // Select this window (for visual selection only, NOT for recording)
154
155
  self.isSelectedWindow = YES;
155
156
 
156
- // Update global selected window info
157
- if (g_selectedWindowInfo) {
158
- [g_selectedWindowInfo release];
157
+ // Update global clicked window info (separate from recording selection)
158
+ if (g_clickedWindowInfo) {
159
+ [g_clickedWindowInfo release];
159
160
  }
160
- g_selectedWindowInfo = [self.windowInfo retain];
161
+ g_clickedWindowInfo = [self.windowInfo retain];
161
162
 
162
163
  // Update global selected overlay reference
163
164
  g_selectedOverlayView = self;
164
165
 
165
- NSLog(@"🎯 WINDOW SELECTED - Highlight blocked on this window: %@ - \"%@\"",
166
+ NSLog(@"🎯 WINDOW CLICKED - Visual selection only (NOT recording): %@ - \"%@\"",
166
167
  [self.windowInfo objectForKey:@"appName"] ?: @"Unknown",
167
168
  [self.windowInfo objectForKey:@"title"] ?: @"Untitled");
168
169
  }
@@ -292,14 +293,19 @@ void updateScreenOverlays();
292
293
 
293
294
  @implementation WindowSelectorDelegate
294
295
  - (void)selectButtonClicked:(id)sender {
295
- if (g_selectedWindowInfo) {
296
- // Use the selected window info (from click) instead of cursor position
297
- NSLog(@"🎯 START RECORDING: Selected window confirmed - %@ - \"%@\"",
296
+ if (g_clickedWindowInfo) {
297
+ // Copy clicked window info to recording selection
298
+ if (g_selectedWindowInfo) {
299
+ [g_selectedWindowInfo release];
300
+ }
301
+ g_selectedWindowInfo = [g_clickedWindowInfo retain];
302
+
303
+ NSLog(@"🎯 START RECORDING: Clicked window confirmed for recording - %@ - \"%@\"",
298
304
  [g_selectedWindowInfo objectForKey:@"appName"] ?: @"Unknown",
299
305
  [g_selectedWindowInfo objectForKey:@"title"] ?: @"Untitled");
300
306
  cleanupWindowSelector();
301
307
  } else {
302
- NSLog(@"⚠️ No window selected - cannot start recording");
308
+ NSLog(@"⚠️ No window clicked - cannot start recording");
303
309
  }
304
310
  }
305
311
 
@@ -800,9 +806,9 @@ void updateOverlay() {
800
806
  BOOL isUnderCursor = (windowUnderCursor &&
801
807
  [g_currentWindowUnderCursor isEqualToDictionary:windowUnderCursor]);
802
808
 
803
- // Check if this is the selected window
804
- BOOL isSelected = (g_selectedWindowInfo &&
805
- [g_selectedWindowInfo isEqualToDictionary:windowUnderCursor]);
809
+ // Check if this is the clicked window (visual selection)
810
+ BOOL isSelected = (g_clickedWindowInfo &&
811
+ [g_clickedWindowInfo isEqualToDictionary:windowUnderCursor]);
806
812
 
807
813
  // Allow highlighting on all windows (including selected) but keep selection state
808
814
  overlayView.isActiveWindow = isUnderCursor; // Highlight if under cursor
@@ -855,6 +861,12 @@ void cleanupWindowSelector() {
855
861
  g_selectedOverlayView.isSelectedWindow = NO;
856
862
  g_selectedOverlayView = nil;
857
863
  }
864
+
865
+ // Clear clicked window info (visual selection)
866
+ if (g_clickedWindowInfo) {
867
+ [g_clickedWindowInfo release];
868
+ g_clickedWindowInfo = nil;
869
+ }
858
870
  }
859
871
 
860
872
  // Recording preview functions
@@ -1537,6 +1549,10 @@ Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
1537
1549
  [g_selectedWindowInfo release];
1538
1550
  g_selectedWindowInfo = nil;
1539
1551
  }
1552
+ if (g_clickedWindowInfo) {
1553
+ [g_clickedWindowInfo release];
1554
+ g_clickedWindowInfo = nil;
1555
+ }
1540
1556
  if (g_selectedOverlayView) {
1541
1557
  g_selectedOverlayView.isSelectedWindow = NO;
1542
1558
  g_selectedOverlayView = nil;