node-mac-recorder 2.7.3 → 2.7.4
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 +28 -13
package/package.json
CHANGED
package/src/window_selector.mm
CHANGED
|
@@ -81,19 +81,19 @@ void updateScreenOverlays();
|
|
|
81
81
|
|
|
82
82
|
- (void)updateAppearance {
|
|
83
83
|
if (self.isSelectedWindow) {
|
|
84
|
-
// Selected window: bright background with thick border
|
|
84
|
+
// Selected window: bright background with thick border (2-3px)
|
|
85
85
|
self.layer.backgroundColor = [[NSColor colorWithRed:0.6 green:0.4 blue:0.9 alpha:0.6] CGColor];
|
|
86
86
|
self.layer.borderColor = [[NSColor colorWithRed:0.6 green:0.4 blue:0.9 alpha:1.0] CGColor];
|
|
87
|
-
self.layer.borderWidth =
|
|
87
|
+
self.layer.borderWidth = 2.5; // Thick border for selected window
|
|
88
88
|
// Selected window appearance set
|
|
89
89
|
} else if (self.isActiveWindow) {
|
|
90
|
-
// Active window (highlighted):
|
|
90
|
+
// Active window (highlighted): thin border (1px)
|
|
91
91
|
self.layer.backgroundColor = [[NSColor colorWithRed:0.6 green:0.4 blue:0.9 alpha:0.4] CGColor];
|
|
92
92
|
self.layer.borderColor = [[NSColor colorWithRed:0.6 green:0.4 blue:0.9 alpha:0.8] CGColor];
|
|
93
93
|
self.layer.borderWidth = 1.0; // Thin border for highlighted window
|
|
94
94
|
// Active window appearance set
|
|
95
95
|
} else {
|
|
96
|
-
// Inactive window:
|
|
96
|
+
// Inactive window: no border
|
|
97
97
|
self.layer.backgroundColor = [[NSColor colorWithRed:0.4 green:0.2 blue:0.6 alpha:0.25] CGColor];
|
|
98
98
|
self.layer.borderColor = [[NSColor clearColor] CGColor];
|
|
99
99
|
self.layer.borderWidth = 0.0; // No border for inactive window
|
|
@@ -123,15 +123,18 @@ void updateScreenOverlays();
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
- (void)mouseDown:(NSEvent *)event {
|
|
126
|
-
// Handle mouse click to toggle window selection
|
|
126
|
+
// Handle mouse click to toggle window selection (ONLY selection, no recording start)
|
|
127
127
|
if (self.windowInfo) {
|
|
128
128
|
// Check if this window is already selected
|
|
129
129
|
BOOL wasSelected = (g_selectedWindowInfo &&
|
|
130
130
|
[g_selectedWindowInfo isEqualToDictionary:self.windowInfo]);
|
|
131
131
|
|
|
132
132
|
if (wasSelected) {
|
|
133
|
-
// Deselect this window
|
|
134
|
-
|
|
133
|
+
// Deselect this window - return to normal highlight behavior
|
|
134
|
+
if (g_selectedOverlayView) {
|
|
135
|
+
g_selectedOverlayView.isSelectedWindow = NO;
|
|
136
|
+
[g_selectedOverlayView updateAppearance];
|
|
137
|
+
}
|
|
135
138
|
|
|
136
139
|
// Clear global selection
|
|
137
140
|
if (g_selectedWindowInfo) {
|
|
@@ -140,10 +143,16 @@ void updateScreenOverlays();
|
|
|
140
143
|
}
|
|
141
144
|
g_selectedOverlayView = nil;
|
|
142
145
|
|
|
143
|
-
NSLog(@"🚫 WINDOW DESELECTED
|
|
146
|
+
NSLog(@"🚫 WINDOW DESELECTED - Back to normal highlight mode: %@ - \"%@\"",
|
|
144
147
|
[self.windowInfo objectForKey:@"appName"] ?: @"Unknown",
|
|
145
148
|
[self.windowInfo objectForKey:@"title"] ?: @"Untitled");
|
|
146
149
|
} else {
|
|
150
|
+
// Deselect previous window if any
|
|
151
|
+
if (g_selectedOverlayView && g_selectedOverlayView != self) {
|
|
152
|
+
g_selectedOverlayView.isSelectedWindow = NO;
|
|
153
|
+
[g_selectedOverlayView updateAppearance];
|
|
154
|
+
}
|
|
155
|
+
|
|
147
156
|
// Select this window
|
|
148
157
|
self.isSelectedWindow = YES;
|
|
149
158
|
|
|
@@ -156,13 +165,15 @@ void updateScreenOverlays();
|
|
|
156
165
|
// Update global selected overlay reference
|
|
157
166
|
g_selectedOverlayView = self;
|
|
158
167
|
|
|
159
|
-
NSLog(@"🎯 WINDOW SELECTED
|
|
168
|
+
NSLog(@"🎯 WINDOW SELECTED - Highlight blocked on this window: %@ - \"%@\"",
|
|
160
169
|
[self.windowInfo objectForKey:@"appName"] ?: @"Unknown",
|
|
161
170
|
[self.windowInfo objectForKey:@"title"] ?: @"Untitled");
|
|
162
171
|
}
|
|
163
172
|
|
|
164
|
-
// Update overlay
|
|
173
|
+
// Update appearance for this overlay
|
|
165
174
|
[self updateAppearance];
|
|
175
|
+
|
|
176
|
+
// DON'T start recording here - that's only for the "Start Record" button
|
|
166
177
|
}
|
|
167
178
|
}
|
|
168
179
|
|
|
@@ -796,12 +807,16 @@ void updateOverlay() {
|
|
|
796
807
|
BOOL isSelected = (g_selectedWindowInfo &&
|
|
797
808
|
[g_selectedWindowInfo isEqualToDictionary:windowUnderCursor]);
|
|
798
809
|
|
|
799
|
-
//
|
|
800
|
-
|
|
810
|
+
// If window is selected, don't allow highlighting on it
|
|
811
|
+
if (isSelected) {
|
|
812
|
+
overlayView.isActiveWindow = NO; // No highlight on selected window
|
|
813
|
+
} else {
|
|
814
|
+
overlayView.isActiveWindow = isUnderCursor; // Highlight if under cursor and not selected
|
|
815
|
+
}
|
|
801
816
|
overlayView.isSelectedWindow = isSelected;
|
|
802
817
|
|
|
803
818
|
NSLog(@"🎯 Overlay State Updated: Active=%s, Selected=%s",
|
|
804
|
-
|
|
819
|
+
overlayView.isActiveWindow ? "YES" : "NO", isSelected ? "YES" : "NO");
|
|
805
820
|
}
|
|
806
821
|
}
|
|
807
822
|
}
|