commit 25504828f09cee19245fc46a952386eb1a05e3cb
Author: Stephan Witt <[email protected]>
Date: Mon Jan 5 17:28:36 2026 +0100
Move check for macos defaults to control cursor flash time from GUI startup
to caret setup in GUI work area
---
src/frontends/qt/GuiApplication.cpp | 15 ---------------
src/frontends/qt/GuiWorkArea.cpp | 17 ++++++++++++++++-
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/src/frontends/qt/GuiApplication.cpp
b/src/frontends/qt/GuiApplication.cpp
index 4ff41bd9f2..e09ae95409 100644
--- a/src/frontends/qt/GuiApplication.cpp
+++ b/src/frontends/qt/GuiApplication.cpp
@@ -177,21 +177,6 @@ frontend::Application * createApplication(int & argc, char
* argv[])
AllowSetForegroundWindow(ASFW_ANY);
#endif
-
-#if defined(Q_OS_MAC)
- int const cursor_time_on = NSTextInsertionPointBlinkPeriodOn();
- int const cursor_time_off = NSTextInsertionPointBlinkPeriodOff();
- if (cursor_time_on > 0 && cursor_time_off > 0) {
- QApplication::setCursorFlashTime(cursor_time_on +
cursor_time_off);
- } else if (cursor_time_on <= 0 && cursor_time_off > 0) {
- // Off is set and On is undefined of zero
- QApplication::setCursorFlashTime(0);
- } else if (cursor_time_off <= 0 && cursor_time_on > 0) {
- // On is set and Off is undefined of zero
- QApplication::setCursorFlashTime(0);
- }
-#endif
-
// Setup high DPI handling. This is a bit complicated, but will be default in
Qt6.
// macOS does it by itself.
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && !defined(Q_OS_MAC)
diff --git a/src/frontends/qt/GuiWorkArea.cpp b/src/frontends/qt/GuiWorkArea.cpp
index 22d0971b82..16040d428c 100644
--- a/src/frontends/qt/GuiWorkArea.cpp
+++ b/src/frontends/qt/GuiWorkArea.cpp
@@ -53,6 +53,7 @@
#include <QInputMethod>
#ifdef Q_OS_MAC
#include <QProxyStyle>
+#include "support/AppleSupport.h"
#endif
#include <QMenu>
#include <QPainter>
@@ -339,7 +340,21 @@ void GuiWorkArea::startBlinkingCaret()
// Avoid blinking when debugging PAINTING, since it creates too much
noise
if (!lyxerr.debugging(Debug::PAINTING)) {
// we are not supposed to cache this value.
- int const time = QApplication::cursorFlashTime() / 2;
+ int time = QApplication::cursorFlashTime() / 2;
+#if defined(Q_OS_MAC)
+ int const cursor_time_on = NSTextInsertionPointBlinkPeriodOn();
+ int const cursor_time_off =
NSTextInsertionPointBlinkPeriodOff();
+ if (cursor_time_on > 0 && cursor_time_off > 0) {
+ // Off and On are set and valid
+ time = cursor_time_on + cursor_time_off;
+ } else if (cursor_time_on <= 0 && cursor_time_off > 0) {
+ // Off is set and On is undefined or zero
+ time = 0;
+ } else if (cursor_time_off <= 0 && cursor_time_on > 0) {
+ // On is set and Off is undefined or zero
+ time = 0;
+ }
+#endif
if (time <= 0)
return;
d->caret_timeout_.setInterval(time);
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs