node-mac-recorder 2.10.32 → 2.10.34

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.32",
3
+ "version": "2.10.34",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -326,8 +326,8 @@ void updateScreenOverlays();
326
326
  self = [super initWithFrame:frameRect];
327
327
  if (self) {
328
328
  self.wantsLayer = YES;
329
- // Semi-transparent purple background for screen/window overlay
330
- self.layer.backgroundColor = [[NSColor colorWithRed:0.27 green:0.0 blue:0.77 alpha:0.18] CGColor];
329
+ // Semi-transparent black background for screen overlay (same as window overlay)
330
+ self.layer.backgroundColor = [[NSColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.3] CGColor];
331
331
  // Ensure no borders or decorations
332
332
  self.layer.borderWidth = 1.0;
333
333
  self.layer.cornerRadius = 8.0;
@@ -387,8 +387,8 @@ void updateScreenOverlays();
387
387
  self = [super initWithFrame:frameRect];
388
388
  if (self) {
389
389
  self.wantsLayer = YES;
390
- // Semi-transparent purple background for screen/window overlay
391
- self.layer.backgroundColor = [[NSColor colorWithRed:0.27 green:0.0 blue:0.77 alpha:0.18] CGColor];
390
+ // Semi-transparent black background for screen overlay (same as window overlay)
391
+ self.layer.backgroundColor = [[NSColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.3] CGColor];
392
392
  // Ensure no borders or decorations
393
393
  self.layer.borderWidth = 1.0;
394
394
  self.layer.cornerRadius = 8.0;
@@ -419,6 +419,20 @@ void updateScreenOverlays();
419
419
  // No border for clean look
420
420
  }
421
421
 
422
+ - (void)setIsActiveScreen:(BOOL)isActive {
423
+ _isActiveScreen = isActive;
424
+
425
+ if (isActive) {
426
+ // Active screen: locked state purple border (#3d00b047)
427
+ self.layer.borderColor = [[NSColor colorWithRed:0.24 green:0.0 blue:0.69 alpha:0.95] CGColor];
428
+ self.layer.backgroundColor = [[NSColor colorWithRed:0.24 green:0.0 blue:0.69 alpha:0.278] CGColor];
429
+ } else {
430
+ // Inactive screen: normal state purple border (#4400c52e)
431
+ self.layer.borderColor = [[NSColor colorWithRed:0.27 green:0.0 blue:0.77 alpha:0.9] CGColor];
432
+ self.layer.backgroundColor = [[NSColor colorWithRed:0.27 green:0.0 blue:0.77 alpha:0.18] CGColor];
433
+ }
434
+ }
435
+
422
436
  @end
423
437
 
424
438
  // Button action handler and timer target
@@ -932,20 +946,22 @@ void updateOverlay() {
932
946
  NSString *labelAppName = [windowUnderCursor objectForKey:@"appName"] ?: @"Unknown App";
933
947
  [infoLabel setStringValue:[NSString stringWithFormat:@"%@\n%@", labelAppName, labelWindowTitle]];
934
948
 
935
- // Position buttons - Start Record in absolute center of overlay
949
+ // Position buttons - Start Record in center of selected window
936
950
  if (g_selectButton) {
937
951
  NSSize buttonSize = [g_selectButton frame].size;
938
- NSRect overlayFrame = [g_overlayView frame]; // Use overlay view frame for proper centering
952
+ // Use window center for positioning
953
+ CGFloat windowCenterX = x + (width / 2);
954
+ CGFloat windowCenterY = y + (height / 2);
939
955
  NSPoint buttonCenter = NSMakePoint(
940
- (overlayFrame.size.width - buttonSize.width) / 2,
941
- (overlayFrame.size.height - buttonSize.height) / 2 // Perfect center
956
+ windowCenterX - (buttonSize.width / 2),
957
+ windowCenterY - (buttonSize.height / 2) // Perfect center of window
942
958
  );
943
959
  [g_selectButton setFrameOrigin:buttonCenter];
944
960
 
945
- // Position app icon above center
961
+ // Position app icon above window center
946
962
  NSPoint iconCenter = NSMakePoint(
947
- (overlayFrame.size.width - 96) / 2, // Center horizontally on overlay
948
- (overlayFrame.size.height / 2) + 80 // 80px above center
963
+ windowCenterX - (96 / 2), // Center horizontally on window
964
+ windowCenterY + 120 // 120px above window center
949
965
  );
950
966
  [appIconView setFrameOrigin:iconCenter];
951
967
  NSLog(@"🎯 Positioning app icon at: (%.0f, %.0f) for window size: (%.0f, %.0f)",
@@ -965,10 +981,10 @@ void updateOverlay() {
965
981
  floatAnimationX.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
966
982
  [appIconView.layer addAnimation:floatAnimationX forKey:@"floatAnimationX"];
967
983
 
968
- // Position info label between icon and button
984
+ // Position info label between icon and button relative to window center
969
985
  NSPoint labelCenter = NSMakePoint(
970
- (overlayFrame.size.width - [infoLabel frame].size.width) / 2, // Center horizontally on overlay
971
- (overlayFrame.size.height / 2) + 30 // 30px above center, below icon
986
+ windowCenterX - ([infoLabel frame].size.width / 2), // Center horizontally on window
987
+ windowCenterY + 50 // 50px above window center, below icon
972
988
  );
973
989
  [infoLabel setFrameOrigin:labelCenter];
974
990
 
@@ -985,8 +1001,8 @@ void updateOverlay() {
985
1001
  if (cancelButton) {
986
1002
  NSSize cancelButtonSize = [cancelButton frame].size;
987
1003
  NSPoint cancelButtonCenter = NSMakePoint(
988
- (overlayFrame.size.width - cancelButtonSize.width) / 2, // Center horizontally on overlay
989
- (overlayFrame.size.height / 2) - 60 // 60px below center
1004
+ windowCenterX - (cancelButtonSize.width / 2), // Center horizontally on window
1005
+ windowCenterY - 80 // 80px below window center
990
1006
  );
991
1007
  [cancelButton setFrameOrigin:cancelButtonCenter];
992
1008
  }
@@ -1524,7 +1540,7 @@ bool startScreenSelection() {
1524
1540
  // Position screen icon above center
1525
1541
  NSPoint iconCenter = NSMakePoint(
1526
1542
  (screenFrame.size.width - 96) / 2, // Center horizontally (icon is 96px wide)
1527
- (screenFrame.size.height / 2) + 80 // 80px above center
1543
+ (screenFrame.size.height / 2) + 120 // 120px above center
1528
1544
  );
1529
1545
  [screenIconView setFrameOrigin:iconCenter];
1530
1546
 
@@ -1541,13 +1557,13 @@ bool startScreenSelection() {
1541
1557
  // Position info label between icon and button
1542
1558
  NSPoint labelCenter = NSMakePoint(
1543
1559
  (screenFrame.size.width - [screenInfoLabel frame].size.width) / 2, // Center horizontally
1544
- (screenFrame.size.height / 2) + 30 // 30px above center, below icon
1560
+ (screenFrame.size.height / 2) + 50 // 50px above center, below icon
1545
1561
  );
1546
1562
  [screenInfoLabel setFrameOrigin:labelCenter];
1547
1563
 
1548
1564
  NSPoint cancelButtonCenter = NSMakePoint(
1549
1565
  (screenFrame.size.width - [screenCancelButton frame].size.width) / 2,
1550
- (screenFrame.size.height / 2) - 60 // 60px below center
1566
+ (screenFrame.size.height / 2) - 80 // 80px below center
1551
1567
  );
1552
1568
  [screenCancelButton setFrameOrigin:cancelButtonCenter];
1553
1569