node-mac-recorder 2.10.24 → 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 +1 -1
- package/src/window_selector.mm +46 -7
package/package.json
CHANGED
package/src/window_selector.mm
CHANGED
|
@@ -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
|
|
@@ -108,19 +112,26 @@ void updateScreenOverlays();
|
|
|
108
112
|
xRadius:8.0
|
|
109
113
|
yRadius:8.0];
|
|
110
114
|
|
|
111
|
-
// Fill color
|
|
115
|
+
// Fill color with 1px border
|
|
112
116
|
NSColor *fillColor;
|
|
117
|
+
NSColor *strokeColor;
|
|
113
118
|
|
|
114
119
|
if (self.isToggled) {
|
|
115
|
-
// Locked state: slightly different opacity
|
|
120
|
+
// Locked state: slightly different opacity with darker purple stroke
|
|
116
121
|
fillColor = [NSColor colorWithRed:0.6 green:0.4 blue:0.9 alpha:0.5];
|
|
122
|
+
strokeColor = [NSColor colorWithRed:0.45 green:0.25 blue:0.75 alpha:0.9];
|
|
117
123
|
} else {
|
|
118
|
-
// Normal state:
|
|
124
|
+
// Normal state: purple fill with lighter purple stroke
|
|
119
125
|
fillColor = [NSColor colorWithRed:0.6 green:0.4 blue:0.9 alpha:0.4];
|
|
126
|
+
strokeColor = [NSColor colorWithRed:0.7 green:0.5 blue:0.95 alpha:0.8];
|
|
120
127
|
}
|
|
121
128
|
|
|
122
129
|
[fillColor setFill];
|
|
123
130
|
[highlightPath fill];
|
|
131
|
+
|
|
132
|
+
[strokeColor setStroke];
|
|
133
|
+
[highlightPath setLineWidth:1.0];
|
|
134
|
+
[highlightPath stroke];
|
|
124
135
|
}
|
|
125
136
|
|
|
126
137
|
- (void)updateAppearance {
|
|
@@ -244,6 +255,22 @@ void updateScreenOverlays();
|
|
|
244
255
|
|
|
245
256
|
@end
|
|
246
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
|
+
|
|
247
274
|
@implementation OverlayWindowDelegate
|
|
248
275
|
|
|
249
276
|
- (BOOL)windowShouldBecomeKey:(NSWindow *)window {
|
|
@@ -254,6 +281,14 @@ void updateScreenOverlays();
|
|
|
254
281
|
return NO; // Prevent window from becoming main
|
|
255
282
|
}
|
|
256
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
|
+
|
|
257
292
|
@end
|
|
258
293
|
|
|
259
294
|
// Recording preview overlay view - full screen with cutout
|
|
@@ -1710,10 +1745,10 @@ Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
|
|
|
1710
1745
|
// Create full-screen overlay window to prevent window dragging
|
|
1711
1746
|
NSScreen *mainScreen = [NSScreen mainScreen];
|
|
1712
1747
|
NSRect fullScreenFrame = [mainScreen frame];
|
|
1713
|
-
g_overlayWindow = [[
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1748
|
+
g_overlayWindow = [[NoFocusWindow alloc] initWithContentRect:fullScreenFrame
|
|
1749
|
+
styleMask:NSWindowStyleMaskBorderless
|
|
1750
|
+
backing:NSBackingStoreBuffered
|
|
1751
|
+
defer:NO];
|
|
1717
1752
|
|
|
1718
1753
|
// Force completely borderless appearance
|
|
1719
1754
|
[g_overlayWindow setStyleMask:NSWindowStyleMaskBorderless];
|
|
@@ -1767,6 +1802,10 @@ Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
|
|
|
1767
1802
|
}
|
|
1768
1803
|
[g_overlayWindow setDelegate:windowDelegate];
|
|
1769
1804
|
|
|
1805
|
+
// Additional focus prevention - override window methods
|
|
1806
|
+
[g_overlayWindow setAcceptsMouseMovedEvents:YES];
|
|
1807
|
+
[g_overlayWindow setIgnoresMouseEvents:NO];
|
|
1808
|
+
|
|
1770
1809
|
// Create select button with purple theme and hover effects
|
|
1771
1810
|
g_selectButton = [[HoverButton alloc] initWithFrame:NSMakeRect(0, 0, 200, 60)];
|
|
1772
1811
|
[g_selectButton setTitle:@"Start Record"];
|