]> git.lyx.org Git - lyx.git/commitdiff
#12247 disable Qt5 modifier hack for Qt-5.12 version or newer
authorStephan Witt <switt@lyx.org>
Mon, 23 Aug 2021 12:44:36 +0000 (14:44 +0200)
committerStephan Witt <switt@lyx.org>
Mon, 23 Aug 2021 12:44:36 +0000 (14:44 +0200)
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

index c1882f70d5ce10ce40cb588fdf089db92280ac98..77e3dc35d0a9e0829df388e6ad1229c437cfc980 100644 (file)
@@ -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