node-mac-recorder 2.4.4 → 2.4.5

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.4.4",
3
+ "version": "2.4.5",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -221,8 +221,10 @@ bool hideScreenRecordingPreview();
221
221
  @implementation WindowSelectorDelegate
222
222
  - (void)selectButtonClicked:(id)sender {
223
223
  if (g_currentWindowUnderCursor) {
224
- g_selectedWindowInfo = g_currentWindowUnderCursor;
225
- cleanupWindowSelector();
224
+ g_selectedWindowInfo = [g_currentWindowUnderCursor copy];
225
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.05 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
226
+ cleanupWindowSelector();
227
+ });
226
228
  }
227
229
  }
228
230
 
@@ -233,23 +235,22 @@ bool hideScreenRecordingPreview();
233
235
  // Get screen info from global array using button tag
234
236
  if (g_allScreens && screenIndex >= 0 && screenIndex < [g_allScreens count]) {
235
237
  NSDictionary *screenInfo = [g_allScreens objectAtIndex:screenIndex];
236
- g_selectedScreenInfo = screenInfo;
237
-
238
- NSLog(@"🖥️ SCREEN BUTTON CLICKED: %@ (%@)",
239
- [screenInfo objectForKey:@"name"],
240
- [screenInfo objectForKey:@"resolution"]);
241
-
242
- cleanupScreenSelector();
238
+ g_selectedScreenInfo = [screenInfo copy];
239
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.05 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
240
+ cleanupScreenSelector();
241
+ });
243
242
  }
244
243
  }
245
244
 
246
245
  - (void)cancelButtonClicked:(id)sender {
247
- NSLog(@"🚫 CANCEL BUTTON CLICKED: Selection cancelled");
248
- // Clean up without selecting anything
249
246
  if (g_isScreenSelecting) {
250
- cleanupScreenSelector();
247
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.05 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
248
+ cleanupScreenSelector();
249
+ });
251
250
  } else {
252
- cleanupWindowSelector();
251
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.05 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
252
+ cleanupWindowSelector();
253
+ });
253
254
  }
254
255
  }
255
256