node-mac-recorder 2.10.33 → 2.10.35

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.33",
3
+ "version": "2.10.35",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -389,8 +389,9 @@ void updateScreenOverlays();
389
389
  self.wantsLayer = YES;
390
390
  // Semi-transparent black background for screen overlay (same as window overlay)
391
391
  self.layer.backgroundColor = [[NSColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.3] CGColor];
392
- // Ensure no borders or decorations
392
+ // Purple border for screen selection (same as window highlight)
393
393
  self.layer.borderWidth = 1.0;
394
+ self.layer.borderColor = [[NSColor colorWithRed:0.27 green:0.0 blue:0.77 alpha:0.9] CGColor];
394
395
  self.layer.cornerRadius = 8.0;
395
396
  self.layer.masksToBounds = YES;
396
397
  self.layer.shadowOpacity = 0.0;
@@ -419,6 +420,20 @@ void updateScreenOverlays();
419
420
  // No border for clean look
420
421
  }
421
422
 
423
+ - (void)setIsActiveScreen:(BOOL)isActive {
424
+ _isActiveScreen = isActive;
425
+
426
+ if (isActive) {
427
+ // Active screen: locked state purple border (#3d00b047)
428
+ self.layer.borderColor = [[NSColor colorWithRed:0.24 green:0.0 blue:0.69 alpha:0.95] CGColor];
429
+ self.layer.backgroundColor = [[NSColor colorWithRed:0.24 green:0.0 blue:0.69 alpha:0.278] CGColor];
430
+ } else {
431
+ // Inactive screen: normal state purple border (#4400c52e)
432
+ self.layer.borderColor = [[NSColor colorWithRed:0.27 green:0.0 blue:0.77 alpha:0.9] CGColor];
433
+ self.layer.backgroundColor = [[NSColor colorWithRed:0.27 green:0.0 blue:0.77 alpha:0.18] CGColor];
434
+ }
435
+ }
436
+
422
437
  @end
423
438
 
424
439
  // Button action handler and timer target
@@ -932,20 +947,22 @@ void updateOverlay() {
932
947
  NSString *labelAppName = [windowUnderCursor objectForKey:@"appName"] ?: @"Unknown App";
933
948
  [infoLabel setStringValue:[NSString stringWithFormat:@"%@\n%@", labelAppName, labelWindowTitle]];
934
949
 
935
- // Position buttons - Start Record in absolute center of overlay
950
+ // Position buttons - Start Record in center of selected window
936
951
  if (g_selectButton) {
937
952
  NSSize buttonSize = [g_selectButton frame].size;
938
- NSRect overlayFrame = [g_overlayView frame]; // Use overlay view frame for proper centering
953
+ // Use window center for positioning
954
+ CGFloat windowCenterX = x + (width / 2);
955
+ CGFloat windowCenterY = y + (height / 2);
939
956
  NSPoint buttonCenter = NSMakePoint(
940
- (overlayFrame.size.width - buttonSize.width) / 2,
941
- (overlayFrame.size.height - buttonSize.height) / 2 // Perfect center
957
+ windowCenterX - (buttonSize.width / 2),
958
+ windowCenterY - (buttonSize.height / 2) // Perfect center of window
942
959
  );
943
960
  [g_selectButton setFrameOrigin:buttonCenter];
944
961
 
945
- // Position app icon above center
962
+ // Position app icon above window center
946
963
  NSPoint iconCenter = NSMakePoint(
947
- (overlayFrame.size.width - 96) / 2, // Center horizontally on overlay
948
- (overlayFrame.size.height / 2) + 120 // 120px above center
964
+ windowCenterX - (96 / 2), // Center horizontally on window
965
+ windowCenterY + 120 // 120px above window center
949
966
  );
950
967
  [appIconView setFrameOrigin:iconCenter];
951
968
  NSLog(@"🎯 Positioning app icon at: (%.0f, %.0f) for window size: (%.0f, %.0f)",
@@ -965,10 +982,10 @@ void updateOverlay() {
965
982
  floatAnimationX.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
966
983
  [appIconView.layer addAnimation:floatAnimationX forKey:@"floatAnimationX"];
967
984
 
968
- // Position info label between icon and button
985
+ // Position info label between icon and button relative to window center
969
986
  NSPoint labelCenter = NSMakePoint(
970
- (overlayFrame.size.width - [infoLabel frame].size.width) / 2, // Center horizontally on overlay
971
- (overlayFrame.size.height / 2) + 50 // 50px above center, below icon
987
+ windowCenterX - ([infoLabel frame].size.width / 2), // Center horizontally on window
988
+ windowCenterY + 50 // 50px above window center, below icon
972
989
  );
973
990
  [infoLabel setFrameOrigin:labelCenter];
974
991
 
@@ -985,8 +1002,8 @@ void updateOverlay() {
985
1002
  if (cancelButton) {
986
1003
  NSSize cancelButtonSize = [cancelButton frame].size;
987
1004
  NSPoint cancelButtonCenter = NSMakePoint(
988
- (overlayFrame.size.width - cancelButtonSize.width) / 2, // Center horizontally on overlay
989
- (overlayFrame.size.height / 2) - 80 // 80px below center
1005
+ windowCenterX - (cancelButtonSize.width / 2), // Center horizontally on window
1006
+ windowCenterY - 80 // 80px below window center
990
1007
  );
991
1008
  [cancelButton setFrameOrigin:cancelButtonCenter];
992
1009
  }