This repository was archived by the owner on Jul 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -165,6 +165,7 @@ RESOURCE_FILES.__setattr__(
165
165
)
166
166
167
167
OS_LIBS += [
168
+ "-framework Accessibility" ,
168
169
"-framework IOSurface" ,
169
170
"-framework Vision" ,
170
171
]
Original file line number Diff line number Diff line change 23
23
24
24
#import < Cocoa/Cocoa.h>
25
25
#import < Carbon/Carbon.h>
26
+ #import < Accessibility/Accessibility.h>
26
27
#import < AppKit/NSColor.h>
27
28
28
29
// This must be included last:
@@ -386,6 +387,13 @@ static bool SystemWantsDarkTheme() {
386
387
return [aquaOrDarkAqua isEqualToString:NSAppearanceNameDarkAqua];
387
388
}
388
389
390
+ static bool PrefersNonBlinkingTextInsertionIndicator () {
391
+ if (@available (macOS 15.0 , *)) {
392
+ return AXPrefersNonBlinkingTextInsertionIndicator ();
393
+ }
394
+ return false ;
395
+ }
396
+
389
397
nsresult nsLookAndFeel::NativeGetInt (IntID aID, int32_t & aResult) {
390
398
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
391
399
@@ -400,7 +408,7 @@ static bool SystemWantsDarkTheme() {
400
408
aResult = 3 ;
401
409
break ;
402
410
case IntID::CaretBlinkTime:
403
- aResult = 567 ;
411
+ aResult = PrefersNonBlinkingTextInsertionIndicator () ? - 1 : 567 ;
404
412
break ;
405
413
case IntID::CaretWidth:
406
414
aResult = 1 ;
@@ -609,6 +617,15 @@ + (void)startObserving {
609
617
- (instancetype)init {
610
618
self = [super init];
611
619
620
+ if (@available (macOS 15.0 , *)) {
621
+ [NSNotificationCenter.defaultCenter
622
+ addObserver:self
623
+ selector:@selector (cachedValuesChanged)
624
+ name:
625
+ AXPrefersNonBlinkingTextInsertionIndicatorDidChangeNotification
626
+ object:nil];
627
+ }
628
+
612
629
[NSNotificationCenter.defaultCenter
613
630
addObserver:self
614
631
selector:@selector (colorsChanged)
You can’t perform that action at this time.
0 commit comments