node-mac-recorder 2.6.5 → 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.5",
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,12 +934,24 @@ bool startScreenSelection() {
943
934
  [screenInfoArray addObject:screenInfo];
944
935
 
945
936
  // Create overlay window for this screen (FULL screen including menu bar)
946
- // IMPORTANT: Explicitly assign to specific screen
947
- NSWindow *overlayWindow = [[NSWindow alloc] initWithContentRect:screenFrame
948
- styleMask:NSWindowStyleMaskBorderless
949
- backing:NSBackingStoreBuffered
950
- defer:NO
951
- 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
+ }
952
955
 
953
956
  // Window created for specific screen
954
957
 
@@ -1126,17 +1129,23 @@ bool startScreenSelection() {
1126
1129
  // Ensure window frame is correct for this screen
1127
1130
  [overlayWindow setFrame:screenFrame display:YES animate:NO];
1128
1131
 
1129
- // Show overlay - for secondary screens, avoid makeKeyAndOrderFront initially
1132
+ // Show overlay - different strategy for secondary screens
1130
1133
  if (i == 0) {
1131
- // Primary screen - can be key window
1134
+ // Primary screen
1132
1135
  [overlayWindow makeKeyAndOrderFront:nil];
1136
+ // Primary screen overlay shown
1133
1137
  } else {
1134
- // Secondary screens - just order front first
1138
+ // Secondary screens - more aggressive approach
1135
1139
  [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(), ^{
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(), ^{
1138
1147
  [overlayWindow orderFront:nil];
1139
- [overlayWindow setOrderedIndex:0]; // Bring to very front
1148
+ [overlayWindow makeKeyAndOrderFront:nil];
1140
1149
  });
1141
1150
  }
1142
1151