commit 9bc1903f15b1211f71b547af849b08b4c0306266
Author: Stephan Witt <[email protected]>
Date: Mon Jan 5 17:29:52 2026 +0100
Add check for macos system setting to disable cursor blinking if requested
---
src/frontends/qt/GuiWorkArea.cpp | 3 +++
src/support/AppleSupport.h | 1 +
src/support/AppleSupport.m | 12 ++++++++++++
3 files changed, 16 insertions(+)
diff --git a/src/frontends/qt/GuiWorkArea.cpp b/src/frontends/qt/GuiWorkArea.cpp
index 16040d428c..d033d0fe23 100644
--- a/src/frontends/qt/GuiWorkArea.cpp
+++ b/src/frontends/qt/GuiWorkArea.cpp
@@ -353,6 +353,9 @@ void GuiWorkArea::startBlinkingCaret()
} else if (cursor_time_off <= 0 && cursor_time_on > 0) {
// On is set and Off is undefined or zero
time = 0;
+ } else if (PrefersNonBlinkingCursorIndicator()) {
+ // system preference set
+ time = 0;
}
#endif
if (time <= 0)
diff --git a/src/support/AppleSupport.h b/src/support/AppleSupport.h
index 0d2e41adae..ccbb5e39cf 100644
--- a/src/support/AppleSupport.h
+++ b/src/support/AppleSupport.h
@@ -26,6 +26,7 @@ extern "C" {
// and return the integer part of it - return -1 in case of unset value
int NSTextInsertionPointBlinkPeriodOn();
int NSTextInsertionPointBlinkPeriodOff();
+ bool PrefersNonBlinkingCursorIndicator();
#ifdef __cplusplus
}
#endif
diff --git a/src/support/AppleSupport.m b/src/support/AppleSupport.m
index c13158b59a..890cfc29cf 100644
--- a/src/support/AppleSupport.m
+++ b/src/support/AppleSupport.m
@@ -61,3 +61,15 @@ int NSTextInsertionPointBlinkPeriodOff() {
return [prefs objectForKey:@"NSTextInsertionPointBlinkPeriodOff"] ==
nil ?
-1 : [prefs
floatForKey:@"NSTextInsertionPointBlinkPeriodOff"];
}
+
+bool PrefersNonBlinkingCursorIndicator() {
+ NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
+ bool haspref = [prefs
objectForKey:@"PrefersNonBlinkingCursorIndicator"] != nil;
+
+ if (haspref) return [prefs
boolForKey:@"PrefersNonBlinkingCursorIndicator"];
+
+ NSDictionary * accessibility = [prefs
persistentDomainForName:@"com.apple.Accessibility"];
+ id value = accessibility[@"PrefersNonBlinkingCursorIndicator"];
+
+ return value == nil ? NO : [value boolValue];
+}
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs