node-mac-recorder 2.16.22 โ†’ 2.16.23

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "permissions": {
3
3
  "allow": [
4
- "Bash(FORCE_AVFOUNDATION=1 node -e \"\nconsole.log(''๐Ÿš€ FINAL TEST: Ultra-aggressive external display overlay visibility...'');\nconst WindowSelector = require(''./window-selector.js'');\nconst selector = new WindowSelector();\n\nselector.checkPermissions().then(perms => {\n console.log(''โœ… Permissions OK'');\n return selector.startSelection();\n}).then(() => {\n console.log(''โœ… Window selection started'');\n console.log('''');\n console.log(''๐Ÿš€ ULTRA-AGGRESSIVE VISIBILITY TEST:'');\n console.log(''1. External display should show BRIGHT RED button (orderFrontRegardless!)''); \n console.log(''2. Button should be above EVERYTHING (kCGMaximumWindowLevel)'');\n console.log(''3. Try clicking - should see click debug logs'');\n console.log('''');\n console.log(''If you STILL cannot see the red button, there is a deeper macOS issue...'');\n \n setTimeout(() => {\n console.log(''โฐ Final test complete'');\n selector.stopSelection();\n }, 25000);\n}).catch(console.error);\")"
4
+ "Bash(FORCE_AVFOUNDATION=1 node -e \"\nconsole.log(''๐Ÿงช Testing fixed window selector screen ID mapping...'');\nconst WindowSelector = require(''./window-selector.js'');\nconst selector = new WindowSelector();\n\nconst testResults = [];\n\nselector.checkPermissions().then(perms => {\n console.log(''โœ… Permissions OK'');\n console.log('''');\n console.log(''๐Ÿ“‹ Expected Screen IDs from MacRecorder:'');\n console.log('' MacBook (Primary): ID=1, Position=(0,0)'');\n console.log('' External Display: ID=3, Position=(-3440,-56)'');\n console.log('''');\n \n return selector.startSelection();\n}).then(() => {\n console.log(''โœ… Window selection started'');\n console.log(''๐ŸŽฏ Move cursor over windows on BOTH displays to see CGDirectDisplayID mapping logs'');\n console.log('''');\n \n setTimeout(() => {\n console.log(''โฐ Test complete - stopping window selection'');\n selector.stopSelection();\n }, 15000);\n \n}).catch(console.error);\")"
5
5
  ],
6
6
  "deny": [],
7
7
  "ask": []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-mac-recorder",
3
- "version": "2.16.22",
3
+ "version": "2.16.23",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -2360,10 +2360,33 @@ Napi::Value GetSelectedWindowInfo(const Napi::CallbackInfo& info) {
2360
2360
  windowScreen = mainScreen;
2361
2361
  }
2362
2362
 
2363
- // Add screen information
2363
+ // CRITICAL FIX: Add screen information using real CGDirectDisplayID
2364
2364
  NSRect screenFrame = [windowScreen frame];
2365
- result.Set("screenId", Napi::Number::New(env, [[windowScreen deviceDescription] objectForKey:@"NSScreenNumber"] ?
2366
- [[[windowScreen deviceDescription] objectForKey:@"NSScreenNumber"] intValue] : 0));
2365
+
2366
+ // Find real CGDirectDisplayID for this screen (matching GetDisplays logic)
2367
+ CGDirectDisplayID realDisplayID = 0;
2368
+ CGDirectDisplayID activeDisplays[32];
2369
+ uint32_t displayCount;
2370
+ CGGetActiveDisplayList(32, activeDisplays, &displayCount);
2371
+
2372
+ for (uint32_t j = 0; j < displayCount; j++) {
2373
+ CGDirectDisplayID candidateID = activeDisplays[j];
2374
+ CGRect displayBounds = CGDisplayBounds(candidateID);
2375
+
2376
+ if (fabs(screenFrame.origin.x - displayBounds.origin.x) < 1.0 &&
2377
+ fabs(screenFrame.origin.y - displayBounds.origin.y) < 1.0 &&
2378
+ fabs(screenFrame.size.width - displayBounds.size.width) < 1.0 &&
2379
+ fabs(screenFrame.size.height - displayBounds.size.height) < 1.0) {
2380
+ realDisplayID = candidateID;
2381
+ break;
2382
+ }
2383
+ }
2384
+
2385
+ NSLog(@"๐Ÿ” Window screen mapping: Frame=(%.0f,%.0f,%.0fx%.0f) โ†’ CGDirectDisplayID=%u",
2386
+ screenFrame.origin.x, screenFrame.origin.y,
2387
+ screenFrame.size.width, screenFrame.size.height, realDisplayID);
2388
+
2389
+ result.Set("screenId", Napi::Number::New(env, realDisplayID));
2367
2390
  result.Set("screenX", Napi::Number::New(env, (int)screenFrame.origin.x));
2368
2391
  result.Set("screenY", Napi::Number::New(env, (int)screenFrame.origin.y));
2369
2392
  result.Set("screenWidth", Napi::Number::New(env, (int)screenFrame.size.width));