node-mac-recorder 2.10.33 → 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.33",
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": [
@@ -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) + 120 // 120px 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) + 50 // 50px 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) - 80 // 80px 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
  }