aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_messageview.cpp
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-04 10:03:06 +0200
committerDanilo M. <danix@danix.xyz>2026-08-04 12:54:30 +0200
commit9016063582c75f6d9a5fbd770b1f0b2f363b3054 (patch)
tree04d91c3ae539a1a2cfeae35376d8e505edcc0b69 /tests/test_messageview.cpp
parentaa86d61c1a716c2e0a2cdc55ae396808eeb494d1 (diff)
downloadqtmaildir-9016063582c75f6d9a5fbd770b1f0b2f363b3054.tar.gz
qtmaildir-9016063582c75f6d9a5fbd770b1f0b2f363b3054.zip
fix(completion): stop the key filter handing itself the key it forwards
Pressing Tab or an arrow key with the completion popup open crashed the application outright. QCoreApplication::sendEvent re-runs APPLICATION-level event filters. The navigation branch forwarded the key to the popup from inside a filter installed on qApp, so the very same event came back to the filter that had just sent it. The popup was still visible, the popupVisible() guard still passed, and it forwarded again: unbounded recursion ending in a stack overflow rather than in any diagnosable error. Reproduced at 9176 recursive QueryCompleter::eventFilter frames, with a standalone Qt probe confirming the re-entry independently. Guard the filter with m_forwarding, checked before the switch so it covers every branch rather than the navigation keys alone. A key the filter is itself redelivering now falls through to the popup instead of being claimed a second time. The existing tests missed this because they exercised the accept path without ever forwarding an event. arrowNavigationDoesNotRecurse drives Down through the grabbing popup and asserts the selection actually moved, so it fails on a fix that merely swallows the key; against the old code it takes the process down with it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'tests/test_messageview.cpp')
0 files changed, 0 insertions, 0 deletions