node-mac-recorder 2.6.4 → 2.6.6

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.4",
3
+ "version": "2.6.6",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -77,9 +77,6 @@ void updateScreenOverlays();
77
77
  // Background with transparency - purple tone (no border)
78
78
  [[NSColor colorWithRed:0.5 green:0.3 blue:0.8 alpha:0.25] setFill];
79
79
  NSRectFill(self.bounds);
80
-
81
- // Ensure no borders or frames are drawn
82
- // Text will be handled by separate label above button
83
80
  }
84
81
 
85
82
  @end
@@ -175,13 +172,7 @@ void updateScreenOverlays();
175
172
  }
176
173
  NSRectFill(self.bounds);
177
174
 
178
- // Add subtle border for active screen
179
- if (self.isActiveScreen) {
180
- [[NSColor colorWithRed:0.7 green:0.5 blue:1.0 alpha:0.6] setStroke];
181
- NSBezierPath *borderPath = [NSBezierPath bezierPathWithRect:NSInsetRect(self.bounds, 2, 2)];
182
- [borderPath setLineWidth:4.0];
183
- [borderPath stroke];
184
- }
175
+ // No border for clean look
185
176
  }
186
177
 
187
178
  @end
@@ -943,20 +934,39 @@ bool startScreenSelection() {
943
934
  [screenInfoArray addObject:screenInfo];
944
935
 
945
936
  // Create overlay window for this screen (FULL screen including menu bar)
946
- NSWindow *overlayWindow = [[NSWindow alloc] initWithContentRect:screenFrame
947
- styleMask:NSWindowStyleMaskBorderless
948
- backing:NSBackingStoreBuffered
949
- defer:NO
950
- screen:screen];
937
+ // For secondary screens, don't specify screen parameter to avoid issues
938
+ NSWindow *overlayWindow;
939
+ if (i == 0) {
940
+ // Primary screen - use screen parameter
941
+ overlayWindow = [[NSWindow alloc] initWithContentRect:screenFrame
942
+ styleMask:NSWindowStyleMaskBorderless
943
+ backing:NSBackingStoreBuffered
944
+ defer:NO
945
+ screen:screen];
946
+ } else {
947
+ // Secondary screens - create without screen param, set frame manually
948
+ overlayWindow = [[NSWindow alloc] initWithContentRect:screenFrame
949
+ styleMask:NSWindowStyleMaskBorderless
950
+ backing:NSBackingStoreBuffered
951
+ defer:NO];
952
+ // Force specific positioning for secondary screen
953
+ [overlayWindow setFrameOrigin:screenFrame.origin];
954
+ }
955
+
956
+ // Window created for specific screen
951
957
 
952
- [overlayWindow setLevel:CGWindowLevelForKey(kCGMaximumWindowLevelKey)];
958
+ // Use a high but not maximum level to avoid issues with secondary displays
959
+ [overlayWindow setLevel:CGWindowLevelForKey(kCGFloatingWindowLevelKey) + 1000];
953
960
  [overlayWindow setOpaque:NO];
954
961
  [overlayWindow setBackgroundColor:[NSColor clearColor]];
955
962
  [overlayWindow setIgnoresMouseEvents:NO];
956
963
  [overlayWindow setAcceptsMouseMovedEvents:YES];
957
964
  [overlayWindow setHasShadow:NO];
958
965
  [overlayWindow setAlphaValue:1.0];
959
- [overlayWindow setCollectionBehavior:NSWindowCollectionBehaviorStationary | NSWindowCollectionBehaviorCanJoinAllSpaces];
966
+ // Ensure window appears on all spaces and stays put
967
+ [overlayWindow setCollectionBehavior:NSWindowCollectionBehaviorStationary |
968
+ NSWindowCollectionBehaviorCanJoinAllSpaces |
969
+ NSWindowCollectionBehaviorIgnoresCycle];
960
970
 
961
971
  // Remove any default window decorations and borders
962
972
  [overlayWindow setTitlebarAppearsTransparent:YES];
@@ -1116,13 +1126,35 @@ bool startScreenSelection() {
1116
1126
  [overlayView addSubview:selectButton];
1117
1127
  [overlayView addSubview:screenCancelButton];
1118
1128
 
1119
- [overlayWindow orderFront:nil];
1120
- [overlayWindow makeKeyAndOrderFront:nil];
1129
+ // Ensure window frame is correct for this screen
1130
+ [overlayWindow setFrame:screenFrame display:YES animate:NO];
1131
+
1132
+ // Show overlay - different strategy for secondary screens
1133
+ if (i == 0) {
1134
+ // Primary screen
1135
+ [overlayWindow makeKeyAndOrderFront:nil];
1136
+ // Primary screen overlay shown
1137
+ } else {
1138
+ // Secondary screens - more aggressive approach
1139
+ [overlayWindow orderFront:nil];
1140
+ [overlayWindow makeKeyAndOrderFront:nil]; // Try makeKey too
1141
+ [overlayWindow setLevel:CGWindowLevelForKey(kCGFloatingWindowLevelKey) + 2000]; // Even higher level
1142
+
1143
+ // Secondary screen overlay shown
1144
+
1145
+ // Double-check with delayed re-show
1146
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
1147
+ [overlayWindow orderFront:nil];
1148
+ [overlayWindow makeKeyAndOrderFront:nil];
1149
+ });
1150
+ }
1121
1151
 
1122
1152
  // Additional visibility settings
1123
1153
  [overlayWindow setAlphaValue:1.0];
1124
1154
  [overlayWindow setIsVisible:YES];
1125
1155
 
1156
+ // Overlay window is now ready and visible
1157
+
1126
1158
  [g_screenOverlayWindows addObject:overlayWindow];
1127
1159
  [screenInfo release];
1128
1160
  }