node-mac-recorder 2.5.5 → 2.5.6
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 +79 -0
package/package.json
CHANGED
package/src/window_selector.mm
CHANGED
|
@@ -59,6 +59,9 @@ bool hideScreenRecordingPreview();
|
|
|
59
59
|
if (self) {
|
|
60
60
|
self.wantsLayer = YES;
|
|
61
61
|
self.layer.backgroundColor = [[NSColor clearColor] CGColor];
|
|
62
|
+
// Ensure no borders or decorations
|
|
63
|
+
self.layer.borderWidth = 0.0;
|
|
64
|
+
self.layer.cornerRadius = 0.0;
|
|
62
65
|
}
|
|
63
66
|
return self;
|
|
64
67
|
}
|
|
@@ -72,6 +75,7 @@ bool hideScreenRecordingPreview();
|
|
|
72
75
|
[[NSColor colorWithRed:0.5 green:0.3 blue:0.8 alpha:0.25] setFill];
|
|
73
76
|
NSRectFill(self.bounds);
|
|
74
77
|
|
|
78
|
+
// Ensure no borders or frames are drawn
|
|
75
79
|
// Text will be handled by separate label above button
|
|
76
80
|
}
|
|
77
81
|
|
|
@@ -89,6 +93,9 @@ bool hideScreenRecordingPreview();
|
|
|
89
93
|
if (self) {
|
|
90
94
|
self.wantsLayer = YES;
|
|
91
95
|
self.layer.backgroundColor = [[NSColor clearColor] CGColor];
|
|
96
|
+
// Ensure no borders or decorations
|
|
97
|
+
self.layer.borderWidth = 0.0;
|
|
98
|
+
self.layer.cornerRadius = 0.0;
|
|
92
99
|
}
|
|
93
100
|
return self;
|
|
94
101
|
}
|
|
@@ -141,6 +148,9 @@ bool hideScreenRecordingPreview();
|
|
|
141
148
|
if (self) {
|
|
142
149
|
self.wantsLayer = YES;
|
|
143
150
|
self.layer.backgroundColor = [[NSColor clearColor] CGColor];
|
|
151
|
+
// Ensure no borders or decorations
|
|
152
|
+
self.layer.borderWidth = 0.0;
|
|
153
|
+
self.layer.cornerRadius = 0.0;
|
|
144
154
|
}
|
|
145
155
|
return self;
|
|
146
156
|
}
|
|
@@ -151,6 +161,7 @@ bool hideScreenRecordingPreview();
|
|
|
151
161
|
if (!self.screenInfo) return;
|
|
152
162
|
|
|
153
163
|
// Background with transparency - purple tone (no border)
|
|
164
|
+
// Ensure no borders or frames are drawn
|
|
154
165
|
[[NSColor colorWithRed:0.5 green:0.3 blue:0.8 alpha:0.3] setFill];
|
|
155
166
|
NSRectFill(self.bounds);
|
|
156
167
|
|
|
@@ -712,6 +723,12 @@ bool showRecordingPreview(NSDictionary *windowInfo) {
|
|
|
712
723
|
[g_recordingPreviewWindow setAlphaValue:1.0];
|
|
713
724
|
[g_recordingPreviewWindow setCollectionBehavior:NSWindowCollectionBehaviorStationary | NSWindowCollectionBehaviorCanJoinAllSpaces];
|
|
714
725
|
|
|
726
|
+
// Remove any default window decorations and borders
|
|
727
|
+
[g_recordingPreviewWindow setTitlebarAppearsTransparent:YES];
|
|
728
|
+
[g_recordingPreviewWindow setTitleVisibility:NSWindowTitleHidden];
|
|
729
|
+
[g_recordingPreviewWindow setMovable:NO];
|
|
730
|
+
[g_recordingPreviewWindow setMovableByWindowBackground:NO];
|
|
731
|
+
|
|
715
732
|
// Create preview view
|
|
716
733
|
g_recordingPreviewView = [[RecordingPreviewView alloc] initWithFrame:screenFrame];
|
|
717
734
|
[(RecordingPreviewView *)g_recordingPreviewView setRecordingWindowInfo:windowInfo];
|
|
@@ -819,6 +836,12 @@ bool startScreenSelection() {
|
|
|
819
836
|
[overlayWindow setAlphaValue:1.0];
|
|
820
837
|
[overlayWindow setCollectionBehavior:NSWindowCollectionBehaviorStationary | NSWindowCollectionBehaviorCanJoinAllSpaces];
|
|
821
838
|
|
|
839
|
+
// Remove any default window decorations and borders
|
|
840
|
+
[overlayWindow setTitlebarAppearsTransparent:YES];
|
|
841
|
+
[overlayWindow setTitleVisibility:NSWindowTitleHidden];
|
|
842
|
+
[overlayWindow setMovable:NO];
|
|
843
|
+
[overlayWindow setMovableByWindowBackground:NO];
|
|
844
|
+
|
|
822
845
|
// Create overlay view
|
|
823
846
|
ScreenSelectorOverlayView *overlayView = [[ScreenSelectorOverlayView alloc] initWithFrame:screenFrame];
|
|
824
847
|
[overlayView setScreenInfo:screenInfo];
|
|
@@ -838,6 +861,12 @@ bool startScreenSelection() {
|
|
|
838
861
|
[selectButton.layer setCornerRadius:8.0];
|
|
839
862
|
[selectButton.layer setBorderWidth:0.0];
|
|
840
863
|
|
|
864
|
+
// Remove all button borders and decorations
|
|
865
|
+
[selectButton.layer setShadowOpacity:0.0];
|
|
866
|
+
[selectButton.layer setShadowRadius:0.0];
|
|
867
|
+
[selectButton.layer setShadowOffset:NSMakeSize(0, 0)];
|
|
868
|
+
[selectButton.layer setMasksToBounds:YES];
|
|
869
|
+
|
|
841
870
|
// Clean white text - normal weight
|
|
842
871
|
[selectButton setFont:[NSFont systemFontOfSize:16 weight:NSFontWeightRegular]];
|
|
843
872
|
[selectButton setTitle:@"Start Record"];
|
|
@@ -857,6 +886,10 @@ bool startScreenSelection() {
|
|
|
857
886
|
[selectButton setTarget:g_delegate];
|
|
858
887
|
[selectButton setAction:@selector(screenSelectButtonClicked:)];
|
|
859
888
|
|
|
889
|
+
// Remove focus ring and other default button behaviors
|
|
890
|
+
[selectButton setFocusRingType:NSFocusRingTypeNone];
|
|
891
|
+
[selectButton setShowsBorderOnlyWhileMouseInside:NO];
|
|
892
|
+
|
|
860
893
|
// Create cancel button for screen selection
|
|
861
894
|
NSButton *screenCancelButton = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 120, 40)];
|
|
862
895
|
[screenCancelButton setTitle:@"Cancel"];
|
|
@@ -870,6 +903,12 @@ bool startScreenSelection() {
|
|
|
870
903
|
[screenCancelButton.layer setCornerRadius:8.0];
|
|
871
904
|
[screenCancelButton.layer setBorderWidth:0.0];
|
|
872
905
|
|
|
906
|
+
// Remove all button borders and decorations
|
|
907
|
+
[screenCancelButton.layer setShadowOpacity:0.0];
|
|
908
|
+
[screenCancelButton.layer setShadowRadius:0.0];
|
|
909
|
+
[screenCancelButton.layer setShadowOffset:NSMakeSize(0, 0)];
|
|
910
|
+
[screenCancelButton.layer setMasksToBounds:YES];
|
|
911
|
+
|
|
873
912
|
// Clean white text for cancel button
|
|
874
913
|
[screenCancelButton setFont:[NSFont systemFontOfSize:15 weight:NSFontWeightRegular]];
|
|
875
914
|
NSMutableAttributedString *screenCancelTitleString = [[NSMutableAttributedString alloc]
|
|
@@ -882,6 +921,10 @@ bool startScreenSelection() {
|
|
|
882
921
|
[screenCancelButton setTarget:g_delegate];
|
|
883
922
|
[screenCancelButton setAction:@selector(cancelButtonClicked:)];
|
|
884
923
|
|
|
924
|
+
// Remove focus ring and other default button behaviors
|
|
925
|
+
[screenCancelButton setFocusRingType:NSFocusRingTypeNone];
|
|
926
|
+
[screenCancelButton setShowsBorderOnlyWhileMouseInside:NO];
|
|
927
|
+
|
|
885
928
|
// Create info label for screen
|
|
886
929
|
NSTextField *screenInfoLabel = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, screenFrame.size.width - 40, 60)];
|
|
887
930
|
[screenInfoLabel setEditable:NO];
|
|
@@ -1042,6 +1085,12 @@ bool showScreenRecordingPreview(NSDictionary *screenInfo) {
|
|
|
1042
1085
|
[overlayWindow setAlphaValue:1.0];
|
|
1043
1086
|
[overlayWindow setCollectionBehavior:NSWindowCollectionBehaviorStationary | NSWindowCollectionBehaviorCanJoinAllSpaces];
|
|
1044
1087
|
|
|
1088
|
+
// Remove any default window decorations and borders
|
|
1089
|
+
[overlayWindow setTitlebarAppearsTransparent:YES];
|
|
1090
|
+
[overlayWindow setTitleVisibility:NSWindowTitleHidden];
|
|
1091
|
+
[overlayWindow setMovable:NO];
|
|
1092
|
+
[overlayWindow setMovableByWindowBackground:NO];
|
|
1093
|
+
|
|
1045
1094
|
[overlayWindow orderFront:nil];
|
|
1046
1095
|
[overlayWindow makeKeyAndOrderFront:nil];
|
|
1047
1096
|
|
|
@@ -1099,10 +1148,20 @@ Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
|
|
|
1099
1148
|
[g_overlayWindow setAlphaValue:1.0];
|
|
1100
1149
|
[g_overlayWindow setCollectionBehavior:NSWindowCollectionBehaviorStationary | NSWindowCollectionBehaviorCanJoinAllSpaces];
|
|
1101
1150
|
|
|
1151
|
+
// Remove any default window decorations and borders
|
|
1152
|
+
[g_overlayWindow setTitlebarAppearsTransparent:YES];
|
|
1153
|
+
[g_overlayWindow setTitleVisibility:NSWindowTitleHidden];
|
|
1154
|
+
[g_overlayWindow setMovable:NO];
|
|
1155
|
+
[g_overlayWindow setMovableByWindowBackground:NO];
|
|
1156
|
+
|
|
1102
1157
|
// Create overlay view
|
|
1103
1158
|
g_overlayView = [[WindowSelectorOverlayView alloc] initWithFrame:initialFrame];
|
|
1104
1159
|
[g_overlayWindow setContentView:g_overlayView];
|
|
1105
1160
|
|
|
1161
|
+
// Additional window styling to ensure no borders or decorations
|
|
1162
|
+
[g_overlayWindow setMovable:NO];
|
|
1163
|
+
[g_overlayWindow setMovableByWindowBackground:NO];
|
|
1164
|
+
|
|
1106
1165
|
// Create select button with purple theme
|
|
1107
1166
|
g_selectButton = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 200, 60)];
|
|
1108
1167
|
[g_selectButton setTitle:@"Start Record"];
|
|
@@ -1116,6 +1175,12 @@ Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
|
|
|
1116
1175
|
[g_selectButton.layer setCornerRadius:8.0];
|
|
1117
1176
|
[g_selectButton.layer setBorderWidth:0.0];
|
|
1118
1177
|
|
|
1178
|
+
// Remove all button borders and decorations
|
|
1179
|
+
[g_selectButton.layer setShadowOpacity:0.0];
|
|
1180
|
+
[g_selectButton.layer setShadowRadius:0.0];
|
|
1181
|
+
[g_selectButton.layer setShadowOffset:NSMakeSize(0, 0)];
|
|
1182
|
+
[g_selectButton.layer setMasksToBounds:YES];
|
|
1183
|
+
|
|
1119
1184
|
// Clean white text - normal weight
|
|
1120
1185
|
NSMutableAttributedString *titleString = [[NSMutableAttributedString alloc]
|
|
1121
1186
|
initWithString:[g_selectButton title]];
|
|
@@ -1129,6 +1194,10 @@ Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
|
|
|
1129
1194
|
[g_selectButton setTarget:g_delegate];
|
|
1130
1195
|
[g_selectButton setAction:@selector(selectButtonClicked:)];
|
|
1131
1196
|
|
|
1197
|
+
// Remove focus ring and other default button behaviors
|
|
1198
|
+
[g_selectButton setFocusRingType:NSFocusRingTypeNone];
|
|
1199
|
+
[g_selectButton setShowsBorderOnlyWhileMouseInside:NO];
|
|
1200
|
+
|
|
1132
1201
|
// Add select button directly to window (not view) for proper layering
|
|
1133
1202
|
[g_overlayWindow.contentView addSubview:g_selectButton];
|
|
1134
1203
|
|
|
@@ -1145,6 +1214,12 @@ Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
|
|
|
1145
1214
|
[cancelButton.layer setCornerRadius:8.0];
|
|
1146
1215
|
[cancelButton.layer setBorderWidth:0.0];
|
|
1147
1216
|
|
|
1217
|
+
// Remove all button borders and decorations
|
|
1218
|
+
[cancelButton.layer setShadowOpacity:0.0];
|
|
1219
|
+
[cancelButton.layer setShadowRadius:0.0];
|
|
1220
|
+
[cancelButton.layer setShadowOffset:NSMakeSize(0, 0)];
|
|
1221
|
+
[cancelButton.layer setMasksToBounds:YES];
|
|
1222
|
+
|
|
1148
1223
|
// Clean white text for cancel button
|
|
1149
1224
|
NSMutableAttributedString *cancelTitleString = [[NSMutableAttributedString alloc]
|
|
1150
1225
|
initWithString:[cancelButton title]];
|
|
@@ -1156,6 +1231,10 @@ Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
|
|
|
1156
1231
|
[cancelButton setTarget:g_delegate];
|
|
1157
1232
|
[cancelButton setAction:@selector(cancelButtonClicked:)];
|
|
1158
1233
|
|
|
1234
|
+
// Remove focus ring and other default button behaviors
|
|
1235
|
+
[cancelButton setFocusRingType:NSFocusRingTypeNone];
|
|
1236
|
+
[cancelButton setShowsBorderOnlyWhileMouseInside:NO];
|
|
1237
|
+
|
|
1159
1238
|
// Add cancel button to window
|
|
1160
1239
|
[g_overlayWindow.contentView addSubview:cancelButton];
|
|
1161
1240
|
|