From 50c22e10ce641f8af7495fec48da3398ad89076f Mon Sep 17 00:00:00 2001 From: timpieces Date: Sun, 11 Jan 2026 08:53:29 +0800 Subject: [PATCH] Macro: Fix shortcuts in macro editor #26807 - The initial commit to block shortcuts in text edit fields (particularly for MacOS, where those shortcuts would activate FreeCAD functionality rather than text edit functionality) made a wrong assumption. - It assumed that there were no text edit fields where we would want to actually use application shortcuts. In retrospect, this was very wrong, and I completely missed the macro editor. - For now, it should be fine to change the field to only cover 'LineEdit'. I cannot imagine a case where you'd want to (e.g.) save text/document from a LineEdit, but if anyone knows of one then please let me know. - This does mean there are some quirks. For example in the materials editor, the description is a TextEdit field. Some text editing shortcuts won't work in here now (similar to how they didn't before the original commit that I made). - I've since learned that freecad also has a text editor functionality, I've tested that now Cmd+S works for save as it should. --- src/Gui/ShortcutManager.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Gui/ShortcutManager.cpp b/src/Gui/ShortcutManager.cpp index 4d3e1f52eb..28e996870d 100644 --- a/src/Gui/ShortcutManager.cpp +++ b/src/Gui/ShortcutManager.cpp @@ -315,10 +315,7 @@ bool ShortcutManager::eventFilter(QObject* o, QEvent* ev) auto* maybeProxy = focus->focusProxy(); auto* focusOrProxy = maybeProxy ? maybeProxy : focus; - bool isFocusedWidgetTextInput = focusOrProxy->inherits("QLineEdit") - || focusOrProxy->inherits("QTextEdit") - || focusOrProxy->inherits("QPlainTextEdit"); - if (isFocusedWidgetTextInput) { + if (focusOrProxy->inherits("QLineEdit")) { ev->accept(); return true; }