node-mac-recorder 2.18.8 → 2.18.10
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/.claude/settings.local.json +6 -12
- package/index.js +32 -8
- package/package.json +1 -1
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"permissions": {
|
|
3
3
|
"allow": [
|
|
4
|
-
"Bash(node
|
|
5
|
-
"Bash(
|
|
6
|
-
"Bash(
|
|
7
|
-
"Bash(
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"Bash(timeout:*)",
|
|
11
|
-
"Bash(grep:*)",
|
|
12
|
-
"Bash(./test-cleanup.sh:*)",
|
|
13
|
-
"Bash(FORCE_AVFOUNDATION=1 node test-avfoundation-dpr.js)",
|
|
14
|
-
"Bash(FORCE_AVFOUNDATION=1 node test-cursor-fix.js)",
|
|
15
|
-
"Bash(pkill:*)"
|
|
4
|
+
"Bash(FORCE_AVFOUNDATION=1 node test-cursor-simple.js)",
|
|
5
|
+
"Bash(FORCE_AVFOUNDATION=1 timeout 10 node test-cursor-simple.js)",
|
|
6
|
+
"Bash(jq:*)",
|
|
7
|
+
"Bash(FORCE_AVFOUNDATION=1 timeout 15 node test-cursor-position.js)",
|
|
8
|
+
"Bash(FORCE_AVFOUNDATION=1 timeout 8 node test-cursor-debug.js)",
|
|
9
|
+
"Bash(FORCE_AVFOUNDATION=1 timeout 5 node test-cursor-debug.js)"
|
|
16
10
|
],
|
|
17
11
|
"deny": [],
|
|
18
12
|
"ask": []
|
package/index.js
CHANGED
|
@@ -253,10 +253,10 @@ class MacRecorder extends EventEmitter {
|
|
|
253
253
|
// Recording için display bilgisini sakla (cursor capture için)
|
|
254
254
|
const targetDisplay = displays.find(d => d.id === targetDisplayId);
|
|
255
255
|
|
|
256
|
-
// CRITICAL FIX:
|
|
257
|
-
// This
|
|
258
|
-
|
|
259
|
-
|
|
256
|
+
// CRITICAL FIX: For now, use logical dimensions to avoid cross-display scaling issues
|
|
257
|
+
// This prevents using wrong display's physical dimensions
|
|
258
|
+
let displayScalingInfo = null;
|
|
259
|
+
// TODO: Implement proper per-display scaling detection in native layer
|
|
260
260
|
|
|
261
261
|
this.recordingDisplayInfo = {
|
|
262
262
|
displayId: targetDisplayId,
|
|
@@ -308,10 +308,10 @@ class MacRecorder extends EventEmitter {
|
|
|
308
308
|
}
|
|
309
309
|
|
|
310
310
|
if (targetDisplay) {
|
|
311
|
-
// CRITICAL FIX:
|
|
312
|
-
// This
|
|
313
|
-
const
|
|
314
|
-
|
|
311
|
+
// CRITICAL FIX: For now, use logical dimensions to avoid cross-display scaling issues
|
|
312
|
+
// This prevents using wrong display's physical dimensions
|
|
313
|
+
const displayScalingInfo = null;
|
|
314
|
+
// TODO: Implement proper per-display scaling detection in native layer
|
|
315
315
|
|
|
316
316
|
this.recordingDisplayInfo = {
|
|
317
317
|
displayId: targetDisplay.id,
|
|
@@ -823,6 +823,23 @@ class MacRecorder extends EventEmitter {
|
|
|
823
823
|
|
|
824
824
|
// Apply video-relative transformation for all recording types
|
|
825
825
|
if (this.cursorDisplayInfo && this.cursorDisplayInfo.videoRelative) {
|
|
826
|
+
// FILTER: Only record cursor when it's on the target display
|
|
827
|
+
// Use cached display info to avoid async calls
|
|
828
|
+
const displayX = this.cursorDisplayInfo.displayX;
|
|
829
|
+
const displayY = this.cursorDisplayInfo.displayY;
|
|
830
|
+
const displayWidth = this.cursorDisplayInfo.displayWidth;
|
|
831
|
+
const displayHeight = this.cursorDisplayInfo.displayHeight;
|
|
832
|
+
|
|
833
|
+
const onTargetDisplay = position.x >= displayX &&
|
|
834
|
+
position.x < (displayX + displayWidth) &&
|
|
835
|
+
position.y >= displayY &&
|
|
836
|
+
position.y < (displayY + displayHeight);
|
|
837
|
+
|
|
838
|
+
if (!onTargetDisplay) {
|
|
839
|
+
// Skip cursor data when cursor is on different display
|
|
840
|
+
return;
|
|
841
|
+
}
|
|
842
|
+
|
|
826
843
|
// Step 1: Transform global → display-relative coordinates
|
|
827
844
|
const displayRelativeX = position.x - this.cursorDisplayInfo.displayX;
|
|
828
845
|
const displayRelativeY = position.y - this.cursorDisplayInfo.displayY;
|
|
@@ -937,6 +954,13 @@ class MacRecorder extends EventEmitter {
|
|
|
937
954
|
this.cursorCaptureFile = null;
|
|
938
955
|
}
|
|
939
956
|
|
|
957
|
+
// Native cursor tracking'i durdur
|
|
958
|
+
try {
|
|
959
|
+
nativeBinding.stopCursorTracking();
|
|
960
|
+
} catch (nativeError) {
|
|
961
|
+
console.warn('Native cursor tracking stop failed:', nativeError.message);
|
|
962
|
+
}
|
|
963
|
+
|
|
940
964
|
// Değişkenleri temizle
|
|
941
965
|
this.lastCapturedData = null;
|
|
942
966
|
this.cursorCaptureStartTime = null;
|