node-mac-recorder 1.7.0 → 1.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/index.js CHANGED
@@ -167,6 +167,8 @@ class MacRecorder extends EventEmitter {
167
167
  targetDisplayId = display.id; // Use actual display ID, not array index
168
168
  // Koordinatları display'e göre normalize et
169
169
  adjustedX = targetWindow.x - display.x;
170
+
171
+ // Koordinatları display'e göre normalize et
170
172
  adjustedY = targetWindow.y - display.y;
171
173
  break;
172
174
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-mac-recorder",
3
- "version": "1.7.0",
3
+ "version": "1.9.0",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -25,11 +25,32 @@
25
25
  CGDirectDisplayID *displayList = (CGDirectDisplayID *)malloc(displayCount * sizeof(CGDirectDisplayID));
26
26
  CGGetActiveDisplayList(displayCount, displayList, &displayCount);
27
27
 
28
+ // Get NSScreen list for consistent coordinate system
29
+ NSArray<NSScreen *> *screens = [NSScreen screens];
30
+
28
31
  for (uint32_t i = 0; i < displayCount; i++) {
29
32
  CGDirectDisplayID displayID = displayList[i];
30
33
 
31
- // Get display bounds
32
- CGRect bounds = CGDisplayBounds(displayID);
34
+ // Find corresponding NSScreen for this display ID
35
+ NSScreen *matchingScreen = nil;
36
+ for (NSScreen *screen in screens) {
37
+ // Match by display ID (requires screen.deviceDescription lookup)
38
+ NSDictionary *deviceDescription = [screen deviceDescription];
39
+ NSNumber *screenDisplayID = [deviceDescription objectForKey:@"NSScreenNumber"];
40
+ if (screenDisplayID && [screenDisplayID unsignedIntValue] == displayID) {
41
+ matchingScreen = screen;
42
+ break;
43
+ }
44
+ }
45
+
46
+ // Use NSScreen.frame if found, fallback to CGDisplayBounds
47
+ CGRect bounds;
48
+ if (matchingScreen) {
49
+ NSRect screenFrame = [matchingScreen frame];
50
+ bounds = CGRectMake(screenFrame.origin.x, screenFrame.origin.y, screenFrame.size.width, screenFrame.size.height);
51
+ } else {
52
+ bounds = CGDisplayBounds(displayID);
53
+ }
33
54
 
34
55
  // Create display info dictionary
35
56
  NSDictionary *displayInfo = @{