node-mac-recorder 2.6.6 → 2.6.7
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 +15 -4
package/package.json
CHANGED
package/src/window_selector.mm
CHANGED
|
@@ -53,6 +53,7 @@ void updateScreenOverlays();
|
|
|
53
53
|
// Custom overlay view class
|
|
54
54
|
@interface WindowSelectorOverlayView : NSView
|
|
55
55
|
@property (nonatomic, strong) NSDictionary *windowInfo;
|
|
56
|
+
@property (nonatomic) BOOL isActiveWindow;
|
|
56
57
|
@end
|
|
57
58
|
|
|
58
59
|
@implementation WindowSelectorOverlayView
|
|
@@ -65,6 +66,7 @@ void updateScreenOverlays();
|
|
|
65
66
|
// Ensure no borders or decorations
|
|
66
67
|
self.layer.borderWidth = 0.0;
|
|
67
68
|
self.layer.cornerRadius = 0.0;
|
|
69
|
+
self.isActiveWindow = YES; // Default to active for current window under mouse
|
|
68
70
|
}
|
|
69
71
|
return self;
|
|
70
72
|
}
|
|
@@ -74,8 +76,14 @@ void updateScreenOverlays();
|
|
|
74
76
|
|
|
75
77
|
if (!self.windowInfo) return;
|
|
76
78
|
|
|
77
|
-
// Background with transparency -
|
|
78
|
-
|
|
79
|
+
// Background with transparency - same style as screen overlay
|
|
80
|
+
if (self.isActiveWindow) {
|
|
81
|
+
// Active window: brighter, more opaque (same as active screen)
|
|
82
|
+
[[NSColor colorWithRed:0.6 green:0.4 blue:0.9 alpha:0.4] setFill];
|
|
83
|
+
} else {
|
|
84
|
+
// Inactive window: dimmer, less opaque (same as inactive screen)
|
|
85
|
+
[[NSColor colorWithRed:0.4 green:0.2 blue:0.6 alpha:0.25] setFill];
|
|
86
|
+
}
|
|
79
87
|
NSRectFill(self.bounds);
|
|
80
88
|
}
|
|
81
89
|
|
|
@@ -463,10 +471,13 @@ void updateOverlay() {
|
|
|
463
471
|
if (!windowScreen) windowScreen = [NSScreen mainScreen];
|
|
464
472
|
|
|
465
473
|
// Convert coordinates from CGWindow (top-left) to NSWindow (bottom-left) for the specific screen
|
|
466
|
-
|
|
474
|
+
NSRect screenFrame = [windowScreen frame];
|
|
475
|
+
CGFloat screenHeight = screenFrame.size.height;
|
|
467
476
|
CGFloat adjustedY = screenHeight - y - height;
|
|
468
477
|
|
|
469
|
-
//
|
|
478
|
+
// Window coordinates are in global space, overlay frame should be screen-relative
|
|
479
|
+
// Keep X coordinate as-is (already in global space which is what we want)
|
|
480
|
+
// Only convert Y from top-left to bottom-left coordinate system
|
|
470
481
|
NSRect overlayFrame = NSMakeRect(x, adjustedY, width, height);
|
|
471
482
|
|
|
472
483
|
NSString *windowTitle = [windowUnderCursor objectForKey:@"title"] ?: @"Untitled";
|