node-mac-recorder 2.6.3 → 2.6.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.6.3",
3
+ "version": "2.6.5",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -943,20 +943,27 @@ bool startScreenSelection() {
943
943
  [screenInfoArray addObject:screenInfo];
944
944
 
945
945
  // Create overlay window for this screen (FULL screen including menu bar)
946
+ // IMPORTANT: Explicitly assign to specific screen
946
947
  NSWindow *overlayWindow = [[NSWindow alloc] initWithContentRect:screenFrame
947
948
  styleMask:NSWindowStyleMaskBorderless
948
949
  backing:NSBackingStoreBuffered
949
950
  defer:NO
950
951
  screen:screen];
951
952
 
952
- [overlayWindow setLevel:CGWindowLevelForKey(kCGMaximumWindowLevelKey)];
953
+ // Window created for specific screen
954
+
955
+ // Use a high but not maximum level to avoid issues with secondary displays
956
+ [overlayWindow setLevel:CGWindowLevelForKey(kCGFloatingWindowLevelKey) + 1000];
953
957
  [overlayWindow setOpaque:NO];
954
958
  [overlayWindow setBackgroundColor:[NSColor clearColor]];
955
959
  [overlayWindow setIgnoresMouseEvents:NO];
956
960
  [overlayWindow setAcceptsMouseMovedEvents:YES];
957
961
  [overlayWindow setHasShadow:NO];
958
962
  [overlayWindow setAlphaValue:1.0];
959
- [overlayWindow setCollectionBehavior:NSWindowCollectionBehaviorStationary | NSWindowCollectionBehaviorCanJoinAllSpaces];
963
+ // Ensure window appears on all spaces and stays put
964
+ [overlayWindow setCollectionBehavior:NSWindowCollectionBehaviorStationary |
965
+ NSWindowCollectionBehaviorCanJoinAllSpaces |
966
+ NSWindowCollectionBehaviorIgnoresCycle];
960
967
 
961
968
  // Remove any default window decorations and borders
962
969
  [overlayWindow setTitlebarAppearsTransparent:YES];
@@ -1116,13 +1123,29 @@ bool startScreenSelection() {
1116
1123
  [overlayView addSubview:selectButton];
1117
1124
  [overlayView addSubview:screenCancelButton];
1118
1125
 
1119
- [overlayWindow orderFront:nil];
1120
- [overlayWindow makeKeyAndOrderFront:nil];
1126
+ // Ensure window frame is correct for this screen
1127
+ [overlayWindow setFrame:screenFrame display:YES animate:NO];
1128
+
1129
+ // Show overlay - for secondary screens, avoid makeKeyAndOrderFront initially
1130
+ if (i == 0) {
1131
+ // Primary screen - can be key window
1132
+ [overlayWindow makeKeyAndOrderFront:nil];
1133
+ } else {
1134
+ // Secondary screens - just order front first
1135
+ [overlayWindow orderFront:nil];
1136
+ // Small delay to ensure window is created on correct screen
1137
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
1138
+ [overlayWindow orderFront:nil];
1139
+ [overlayWindow setOrderedIndex:0]; // Bring to very front
1140
+ });
1141
+ }
1121
1142
 
1122
1143
  // Additional visibility settings
1123
1144
  [overlayWindow setAlphaValue:1.0];
1124
1145
  [overlayWindow setIsVisible:YES];
1125
1146
 
1147
+ // Overlay window is now ready and visible
1148
+
1126
1149
  [g_screenOverlayWindows addObject:overlayWindow];
1127
1150
  [screenInfo release];
1128
1151
  }