commit 4f1594813080218879a4d6d6bdc56c96b2c7af0d
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Sun Feb 16 22:12:58 2025 +0100
Make a test for Cocoa dynamic
In general, it is a good idea to replace when possible #ifdef that
rest for a platform with calls to QGuiQpplication::platformName. This
allow the same application to run for example with the xcb backend (I
am not sure this will be possible one day with macOS, though).
As often these days, the real motivation for changing this was to calm
down Coverity Scan.
---
src/frontends/qt/GuiInputMethod.cpp | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/frontends/qt/GuiInputMethod.cpp
b/src/frontends/qt/GuiInputMethod.cpp
index 372811a75e..0833719a6c 100644
--- a/src/frontends/qt/GuiInputMethod.cpp
+++ b/src/frontends/qt/GuiInputMethod.cpp
@@ -256,12 +256,10 @@ void GuiInputMethod::setPreeditStyle(
// Since Qt6 and on MacOS, the initial entry seems to deliver
information
// about the focused segment (undocumented). We formulate the code to
// utilize this fact keeping fail-safe against its failure.
-
-#if defined(Q_OS_MACOS) && QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
- bool initial_tf_entry = true;
-#else
- bool initial_tf_entry = false;
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ bool initial_tf_entry = guiApp->platformName() == "cocoa";
#endif
+
// max segment position whose information we already have
pos_type max_start = -1;
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs