From 75367f85ef86803bc6628a24c78ec872dd764200 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Wed, 7 Oct 2026 17:14:26 +0200 Subject: [PATCH] Radial: suppress gesture while left button is held An RMB press during a left-drag (mid-selection, or while setting up a left+middle chord) must not pop the radial. Guard the gesture start on both the tracked left-held-in-view flag and the live QMouseEvent::buttons() state so a right press with left already down falls through instead of opening the radial. All 5 ctest suites green. --- docs/PLAN.md | 2 ++ src/plugin/ollieplugin.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/docs/PLAN.md b/docs/PLAN.md index 98b986b..903414b 100644 --- a/docs/PLAN.md +++ b/docs/PLAN.md @@ -137,6 +137,8 @@ Therefore the palette is replaced, not extended, and the replacement is built on does the usual primary-selection paste. - Right-button chords are intentionally **not** ported — the right button is the radial gesture. (Revisit later.) +- The radial gesture is suppressed while the left button is held, so an RMB tap + mid-selection (or during a left+middle chord) does not pop the radial. ### M5 — Command vocabulary + project model + switchers — NEXT - `:`-verb pack via `KTextEditor::Command`: `sort`, `align`, `json`, `b64`, diff --git a/src/plugin/ollieplugin.cpp b/src/plugin/ollieplugin.cpp index b2493d8..c39b2ba 100644 --- a/src/plugin/ollieplugin.cpp +++ b/src/plugin/ollieplugin.cpp @@ -399,6 +399,13 @@ bool OllieView::eventFilter(QObject *obj, QEvent *event) return QObject::eventFilter(obj, event); } + // Suppress the radial when the left button is already held: the user is + // mid-selection (or setting up a left+middle chord), not starting a clean + // radial gesture. buttons() reports the other buttons down at press time. + if (m_leftDownInView || (me->buttons() & Qt::LeftButton)) { + return QObject::eventFilter(obj, event); + } + // Pop the radial at the press position and begin the drag gesture. The // press is consumed so the context menu does not appear and the caret is // not moved (an intentional, configured trade-off).