From c5262f04a266cc2e499a4a341daf9528feaa8dd3 Mon Sep 17 00:00:00 2001 From: Stephan Witt Date: Mon, 23 Aug 2021 14:44:36 +0200 Subject: [PATCH] #12247 disable Qt5 modifier hack for Qt-5.12 version or newer Initially Qt5 modifier handling was broken. Therefore a workaround was introduced. This workaround broke the LyX modifier handling with swap of Command-Control-key disabled. The change disables the hack to get the correct behavior in LyX. --- src/frontends/qt/GuiKeySymbol.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt/GuiKeySymbol.cpp b/src/frontends/qt/GuiKeySymbol.cpp index c1882f70d5..77e3dc35d0 100644 --- a/src/frontends/qt/GuiKeySymbol.cpp +++ b/src/frontends/qt/GuiKeySymbol.cpp @@ -859,10 +859,11 @@ bool KeySymbol::operator==(KeySymbol const & ks) const KeyModifier q_key_state(Qt::KeyboardModifiers state) { KeyModifier k = NoModifier; -#if defined(Q_OS_MAC) && QT_VERSION > 0x050000 +#if defined(Q_OS_MAC) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) && (QT_VERSION < QT_VERSION_CHECK(5, 12, 0)) /// Additional check for Control and Meta modifier swap state. /// Starting with Qt 5 the modifiers aren't reported correctly. /// Until this is fixed a correction is required. + /// AFAIK it is fixed at least with Qt 5.12.0 const bool dontSwapCtrlAndMeta = frontend::theGuiApp()->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta); #else -- 2.39.2