node-mac-recorder 2.10.25 → 2.10.26

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.25",
3
+ "version": "2.10.26",
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
+ // Custom window that never becomes key
70
+ @interface NoFocusWindow : NSWindow
71
+ @end
72
+
69
73
  // Window delegate to prevent focus
70
74
  @interface OverlayWindowDelegate : NSObject <NSWindowDelegate>
71
75
  @end
@@ -113,13 +117,13 @@ void updateScreenOverlays();
113
117
  NSColor *strokeColor;
114
118
 
115
119
  if (self.isToggled) {
116
- // Locked state: slightly different opacity
120
+ // Locked state: slightly different opacity with darker purple stroke
117
121
  fillColor = [NSColor colorWithRed:0.6 green:0.4 blue:0.9 alpha:0.5];
118
122
  strokeColor = [NSColor colorWithRed:0.45 green:0.25 blue:0.75 alpha:0.9];
119
123
  } else {
120
- // Normal state: standard fill
124
+ // Normal state: purple fill with lighter purple stroke
121
125
  fillColor = [NSColor colorWithRed:0.6 green:0.4 blue:0.9 alpha:0.4];
122
- strokeColor = [NSColor whiteColor];
126
+ strokeColor = [NSColor colorWithRed:0.7 green:0.5 blue:0.95 alpha:0.8];
123
127
  }
124
128
 
125
129
  [fillColor setFill];
@@ -251,6 +255,22 @@ void updateScreenOverlays();
251
255
 
252
256
  @end
253
257
 
258
+ @implementation NoFocusWindow
259
+
260
+ - (BOOL)canBecomeKeyWindow {
261
+ return NO; // Never accept key status
262
+ }
263
+
264
+ - (BOOL)canBecomeMainWindow {
265
+ return NO; // Never accept main status
266
+ }
267
+
268
+ - (BOOL)acceptsFirstResponder {
269
+ return NO; // Never accept first responder
270
+ }
271
+
272
+ @end
273
+
254
274
  @implementation OverlayWindowDelegate
255
275
 
256
276
  - (BOOL)windowShouldBecomeKey:(NSWindow *)window {
@@ -261,6 +281,14 @@ void updateScreenOverlays();
261
281
  return NO; // Prevent window from becoming main
262
282
  }
263
283
 
284
+ - (BOOL)canBecomeKeyWindow {
285
+ return NO; // Never can become key
286
+ }
287
+
288
+ - (BOOL)canBecomeMainWindow {
289
+ return NO; // Never can become main
290
+ }
291
+
264
292
  @end
265
293
 
266
294
  // Recording preview overlay view - full screen with cutout
@@ -1717,10 +1745,10 @@ Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
1717
1745
  // Create full-screen overlay window to prevent window dragging
1718
1746
  NSScreen *mainScreen = [NSScreen mainScreen];
1719
1747
  NSRect fullScreenFrame = [mainScreen frame];
1720
- g_overlayWindow = [[NSWindow alloc] initWithContentRect:fullScreenFrame
1721
- styleMask:NSWindowStyleMaskBorderless
1722
- backing:NSBackingStoreBuffered
1723
- defer:NO];
1748
+ g_overlayWindow = [[NoFocusWindow alloc] initWithContentRect:fullScreenFrame
1749
+ styleMask:NSWindowStyleMaskBorderless
1750
+ backing:NSBackingStoreBuffered
1751
+ defer:NO];
1724
1752
 
1725
1753
  // Force completely borderless appearance
1726
1754
  [g_overlayWindow setStyleMask:NSWindowStyleMaskBorderless];
@@ -1774,6 +1802,10 @@ Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
1774
1802
  }
1775
1803
  [g_overlayWindow setDelegate:windowDelegate];
1776
1804
 
1805
+ // Additional focus prevention - override window methods
1806
+ [g_overlayWindow setAcceptsMouseMovedEvents:YES];
1807
+ [g_overlayWindow setIgnoresMouseEvents:NO];
1808
+
1777
1809
  // Create select button with purple theme and hover effects
1778
1810
  g_selectButton = [[HoverButton alloc] initWithFrame:NSMakeRect(0, 0, 200, 60)];
1779
1811
  [g_selectButton setTitle:@"Start Record"];