node-mac-recorder 2.10.20 → 2.10.21

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.20",
3
+ "version": "2.10.21",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -66,6 +66,10 @@ void updateScreenOverlays();
66
66
  - (void)setupHoverTracking;
67
67
  @end
68
68
 
69
+ // Window delegate to prevent focus
70
+ @interface OverlayWindowDelegate : NSObject <NSWindowDelegate>
71
+ @end
72
+
69
73
  @implementation WindowSelectorOverlayView
70
74
 
71
75
  - (instancetype)initWithFrame:(NSRect)frameRect {
@@ -79,6 +83,9 @@ void updateScreenOverlays();
79
83
  // Transparent background for full-screen overlay
80
84
  self.layer.backgroundColor = [[NSColor clearColor] CGColor];
81
85
 
86
+ // Disable focus ring completely
87
+ [self setFocusRingType:NSFocusRingTypeNone];
88
+
82
89
  // Window selector overlay view created
83
90
  }
84
91
  return self;
@@ -131,6 +138,14 @@ void updateScreenOverlays();
131
138
  [self setNeedsDisplay:YES];
132
139
  }
133
140
 
141
+ - (BOOL)acceptsFirstResponder {
142
+ return NO; // Never accept focus to prevent blue ring
143
+ }
144
+
145
+ - (BOOL)canBecomeKeyView {
146
+ return NO; // Never become key view
147
+ }
148
+
134
149
  - (void)setIsActiveWindow:(BOOL)isActiveWindow {
135
150
  if (_isActiveWindow != isActiveWindow) {
136
151
  _isActiveWindow = isActiveWindow;
@@ -239,6 +254,18 @@ void updateScreenOverlays();
239
254
 
240
255
  @end
241
256
 
257
+ @implementation OverlayWindowDelegate
258
+
259
+ - (BOOL)windowShouldBecomeKey:(NSWindow *)window {
260
+ return NO; // Prevent window from becoming key to avoid focus ring
261
+ }
262
+
263
+ - (BOOL)windowShouldBecomeMain:(NSWindow *)window {
264
+ return NO; // Prevent window from becoming main
265
+ }
266
+
267
+ @end
268
+
242
269
  // Recording preview overlay view - full screen with cutout
243
270
  @interface RecordingPreviewView : NSView
244
271
  @property (nonatomic, strong) NSDictionary *recordingWindowInfo;
@@ -1716,17 +1743,29 @@ Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
1716
1743
 
1717
1744
  // Note: NSWindow doesn't have setWantsLayer method, only NSView does
1718
1745
 
1719
- // Force content view to have no borders
1746
+ // Force content view to have no borders and no focus ring
1720
1747
  g_overlayWindow.contentView.wantsLayer = YES;
1721
1748
  g_overlayWindow.contentView.layer.borderWidth = 0.0;
1722
1749
  g_overlayWindow.contentView.layer.borderColor = [[NSColor clearColor] CGColor];
1723
1750
  g_overlayWindow.contentView.layer.cornerRadius = 0.0;
1724
1751
  g_overlayWindow.contentView.layer.masksToBounds = YES;
1725
1752
 
1753
+ // Disable focus ring on overlay view
1754
+ if ([g_overlayView respondsToSelector:@selector(setFocusRingType:)]) {
1755
+ [(NSView*)g_overlayView setFocusRingType:NSFocusRingTypeNone];
1756
+ }
1757
+
1726
1758
  // Additional window styling to ensure no borders or decorations
1727
1759
  [g_overlayWindow setMovable:NO];
1728
1760
  [g_overlayWindow setMovableByWindowBackground:NO];
1729
1761
 
1762
+ // Set delegate to prevent focus
1763
+ static OverlayWindowDelegate *windowDelegate = nil;
1764
+ if (!windowDelegate) {
1765
+ windowDelegate = [[OverlayWindowDelegate alloc] init];
1766
+ }
1767
+ [g_overlayWindow setDelegate:windowDelegate];
1768
+
1730
1769
  // Create select button with purple theme and hover effects
1731
1770
  g_selectButton = [[HoverButton alloc] initWithFrame:NSMakeRect(0, 0, 200, 60)];
1732
1771
  [g_selectButton setTitle:@"Start Record"];