node-mac-recorder 2.10.21 → 2.10.23

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.10.21",
3
+ "version": "2.10.23",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -108,29 +108,19 @@ void updateScreenOverlays();
108
108
  xRadius:8.0
109
109
  yRadius:8.0];
110
110
 
111
- // Fill color and border based on toggle state
111
+ // Fill color only - no border
112
112
  NSColor *fillColor;
113
- NSColor *strokeColor;
114
- CGFloat lineWidth;
115
113
 
116
114
  if (self.isToggled) {
117
- // Locked state: thicker border
118
- fillColor = [NSColor colorWithRed:0.6 green:0.4 blue:0.9 alpha:0.4];
119
- strokeColor = [NSColor colorWithRed:0.45 green:0.25 blue:0.75 alpha:0.9];
120
- lineWidth = 3.0;
115
+ // Locked state: slightly different opacity
116
+ fillColor = [NSColor colorWithRed:0.6 green:0.4 blue:0.9 alpha:0.5];
121
117
  } else {
122
- // Normal state: thin border
118
+ // Normal state: standard fill
123
119
  fillColor = [NSColor colorWithRed:0.6 green:0.4 blue:0.9 alpha:0.4];
124
- strokeColor = [NSColor whiteColor];
125
- lineWidth = 1.0;
126
120
  }
127
121
 
128
122
  [fillColor setFill];
129
123
  [highlightPath fill];
130
-
131
- [strokeColor setStroke];
132
- [highlightPath setLineWidth:lineWidth];
133
- [highlightPath stroke];
134
124
  }
135
125
 
136
126
  - (void)updateAppearance {
@@ -201,6 +191,9 @@ void updateScreenOverlays();
201
191
  self = [super initWithFrame:frameRect];
202
192
  if (self) {
203
193
  self.isHovered = NO;
194
+ self.wantsLayer = YES;
195
+ // Set anchor point to center once for consistent scaling
196
+ self.layer.anchorPoint = CGPointMake(0.5, 0.5);
204
197
  [self setupHoverTracking];
205
198
  }
206
199
  return self;
@@ -218,17 +211,16 @@ void updateScreenOverlays();
218
211
  - (void)mouseEntered:(NSEvent *)event {
219
212
  self.isHovered = YES;
220
213
  [self animateScale:1.2 duration:0.15];
214
+ [[NSCursor pointingHandCursor] set];
221
215
  }
222
216
 
223
217
  - (void)mouseExited:(NSEvent *)event {
224
218
  self.isHovered = NO;
225
219
  [self animateScale:1.0 duration:0.15];
220
+ [[NSCursor arrowCursor] set];
226
221
  }
227
222
 
228
223
  - (void)animateScale:(CGFloat)scale duration:(NSTimeInterval)duration {
229
- // Set anchor point to center for center-based scaling
230
- self.layer.anchorPoint = CGPointMake(0.5, 0.5);
231
-
232
224
  [NSAnimationContext beginGrouping];
233
225
  [NSAnimationContext currentContext].duration = duration;
234
226
  [NSAnimationContext currentContext].timingFunction =
@@ -590,6 +582,13 @@ NSDictionary* getWindowUnderCursor(CGPoint point) {
590
582
 
591
583
  // Find window that contains the cursor point
592
584
  for (NSDictionary *window in g_allWindows) {
585
+ NSString *appName = [window objectForKey:@"appName"];
586
+
587
+ // Skip Electron windows (our own overlay)
588
+ if (appName && ([appName containsString:@"Electron"] || [appName containsString:@"node"])) {
589
+ continue;
590
+ }
591
+
593
592
  int x = [[window objectForKey:@"x"] intValue];
594
593
  int y = [[window objectForKey:@"y"] intValue];
595
594
  int width = [[window objectForKey:@"width"] intValue];
@@ -933,7 +932,8 @@ void updateOverlay() {
933
932
  }
934
933
 
935
934
  [g_overlayWindow orderFront:nil];
936
- [g_overlayWindow makeKeyAndOrderFront:nil];
935
+ // DON'T make key - prevents focus ring
936
+ // [g_overlayWindow makeKeyAndOrderFront:nil];
937
937
 
938
938
  // Ensure subviews (except overlay view itself) have no borders after positioning
939
939
  for (NSView *subview in [g_overlayWindow.contentView subviews]) {
@@ -1054,7 +1054,7 @@ bool showRecordingPreview(NSDictionary *windowInfo) {
1054
1054
  [g_recordingPreviewWindow setAcceptsMouseMovedEvents:NO];
1055
1055
  [g_recordingPreviewWindow setHasShadow:NO];
1056
1056
  [g_recordingPreviewWindow setAlphaValue:1.0];
1057
- [g_recordingPreviewWindow setCollectionBehavior:NSWindowCollectionBehaviorStationary | NSWindowCollectionBehaviorCanJoinAllSpaces | NSWindowCollectionBehaviorIgnoresCycle];
1057
+ [g_recordingPreviewWindow setCollectionBehavior:NSWindowCollectionBehaviorTransient | NSWindowCollectionBehaviorIgnoresCycle];
1058
1058
 
1059
1059
  // Remove any default window decorations and borders
1060
1060
  [g_recordingPreviewWindow setTitlebarAppearsTransparent:YES];
@@ -1183,7 +1183,7 @@ void updateScreenOverlays() {
1183
1183
  // Ensure ALL overlays are visible, but active one is on top
1184
1184
  [overlayWindow orderFront:nil];
1185
1185
  if (isActiveScreen) {
1186
- [overlayWindow makeKeyAndOrderFront:nil];
1186
+ [overlayWindow orderFront:nil]; // Don't make key
1187
1187
  } else {
1188
1188
  [overlayWindow orderFront:nil]; // Keep inactive screens visible too
1189
1189
  }
@@ -1328,7 +1328,7 @@ bool startScreenSelection() {
1328
1328
  [overlayWindow setHasShadow:NO];
1329
1329
  [overlayWindow setAlphaValue:1.0];
1330
1330
  // Ensure window appears on all spaces and stays put - match g_overlayWindow
1331
- [overlayWindow setCollectionBehavior:NSWindowCollectionBehaviorStationary | NSWindowCollectionBehaviorCanJoinAllSpaces | NSWindowCollectionBehaviorIgnoresCycle];
1331
+ [overlayWindow setCollectionBehavior:NSWindowCollectionBehaviorTransient | NSWindowCollectionBehaviorIgnoresCycle];
1332
1332
 
1333
1333
  // Remove any default window decorations and borders
1334
1334
  [overlayWindow setTitlebarAppearsTransparent:YES];
@@ -1501,12 +1501,12 @@ bool startScreenSelection() {
1501
1501
  // Show overlay - different strategy for secondary screens
1502
1502
  if (i == 0) {
1503
1503
  // Primary screen
1504
- [overlayWindow makeKeyAndOrderFront:nil];
1504
+ [overlayWindow orderFront:nil]; // Don't make key
1505
1505
  // Primary screen overlay shown
1506
1506
  } else {
1507
1507
  // Secondary screens - more aggressive approach
1508
1508
  [overlayWindow orderFront:nil];
1509
- [overlayWindow makeKeyAndOrderFront:nil]; // Try makeKey too
1509
+ [overlayWindow orderFront:nil]; // Don't make key // Try makeKey too
1510
1510
  [overlayWindow setLevel:CGWindowLevelForKey(kCGMaximumWindowLevelKey)]; // Match g_overlayWindow level
1511
1511
 
1512
1512
  // Secondary screen overlay shown
@@ -1514,7 +1514,7 @@ bool startScreenSelection() {
1514
1514
  // Double-check with delayed re-show
1515
1515
  dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
1516
1516
  [overlayWindow orderFront:nil];
1517
- [overlayWindow makeKeyAndOrderFront:nil];
1517
+ [overlayWindow orderFront:nil]; // Don't make key
1518
1518
  });
1519
1519
  }
1520
1520
 
@@ -1628,7 +1628,7 @@ bool showScreenRecordingPreview(NSDictionary *screenInfo) {
1628
1628
  // no border
1629
1629
  [overlayWindow setStyleMask:NSWindowStyleMaskBorderless];
1630
1630
  [overlayWindow setAlphaValue:1.0];
1631
- [overlayWindow setCollectionBehavior:NSWindowCollectionBehaviorStationary | NSWindowCollectionBehaviorCanJoinAllSpaces | NSWindowCollectionBehaviorIgnoresCycle];
1631
+ [overlayWindow setCollectionBehavior:NSWindowCollectionBehaviorTransient | NSWindowCollectionBehaviorIgnoresCycle];
1632
1632
 
1633
1633
 
1634
1634
  // Force content view to have no borders
@@ -1651,7 +1651,7 @@ bool showScreenRecordingPreview(NSDictionary *screenInfo) {
1651
1651
 
1652
1652
 
1653
1653
  [overlayWindow orderFront:nil];
1654
- [overlayWindow makeKeyAndOrderFront:nil];
1654
+ // [overlayWindow makeKeyAndOrderFront:nil];
1655
1655
 
1656
1656
  // Note: NSWindow doesn't have setWantsLayer method, only NSView does
1657
1657
 
@@ -1724,7 +1724,7 @@ Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
1724
1724
  [g_overlayWindow setAcceptsMouseMovedEvents:YES];
1725
1725
  [g_overlayWindow setHasShadow:NO];
1726
1726
  [g_overlayWindow setAlphaValue:1.0];
1727
- [g_overlayWindow setCollectionBehavior:NSWindowCollectionBehaviorStationary | NSWindowCollectionBehaviorCanJoinAllSpaces | NSWindowCollectionBehaviorFullScreenAuxiliary | NSWindowCollectionBehaviorIgnoresCycle];
1727
+ [g_overlayWindow setCollectionBehavior:NSWindowCollectionBehaviorTransient | NSWindowCollectionBehaviorIgnoresCycle];
1728
1728
 
1729
1729
  // Remove any default window decorations and borders
1730
1730
  [g_overlayWindow setTitlebarAppearsTransparent:YES];