From f9a06f5a21a61ce0631ad305736e80a899fb0748 Mon Sep 17 00:00:00 2001 From: Lukas Holecek Date: Mon, 21 Oct 2024 09:57:19 +0200 Subject: [PATCH] Fix toggling current item selection Fixes #2850 --- src/gui/clipboardbrowser.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui/clipboardbrowser.cpp b/src/gui/clipboardbrowser.cpp index ca661d852..b0057d794 100644 --- a/src/gui/clipboardbrowser.cpp +++ b/src/gui/clipboardbrowser.cpp @@ -1390,6 +1390,16 @@ void ClipboardBrowser::keyPressEvent(QKeyEvent *event) const int key = event->key(); + // WORKAROUND: Avoid triggering search with Ctrl+Space toggle selection action. + if (mods.testFlag(Qt::ControlModifier) && key == Qt::Key_Space) { + const QModelIndex current = currentIndex(); + if (!edit(current, AnyKeyPressed, event)) { + selectionModel()->select(current, selectionCommand(current, event)); + event->accept(); + return; + } + } + // This fixes few issues with default navigation and item selections. switch (key) { case Qt::Key_Up: