node-mac-recorder 1.8.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 +2 -6
- package/package.json +1 -1
- package/src/screen_capture.mm +23 -2
package/index.js
CHANGED
|
@@ -168,12 +168,8 @@ class MacRecorder extends EventEmitter {
|
|
|
168
168
|
// Koordinatları display'e göre normalize et
|
|
169
169
|
adjustedX = targetWindow.x - display.x;
|
|
170
170
|
|
|
171
|
-
//
|
|
172
|
-
|
|
173
|
-
// For primary display, add menu bar height (~22-25px) to Y coordinate
|
|
174
|
-
const isMainDisplay = display.isPrimary;
|
|
175
|
-
const menuBarHeight = isMainDisplay ? 25 : 0; // Menu bar height adjustment
|
|
176
|
-
adjustedY = targetWindow.y - display.y + menuBarHeight;
|
|
171
|
+
// Koordinatları display'e göre normalize et
|
|
172
|
+
adjustedY = targetWindow.y - display.y;
|
|
177
173
|
break;
|
|
178
174
|
}
|
|
179
175
|
}
|
package/package.json
CHANGED
package/src/screen_capture.mm
CHANGED
|
@@ -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
|
-
//
|
|
32
|
-
|
|
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 = @{
|