Long-press popups: one owner, always on screen

- A second long-press finishes the first (typing its choice) before
  opening its own popup, instead of sharing one
- Popups move down over their key when the room above is too small
- No popup over an unknown key: an empty rect made every cell zero wide
- A repeated touch id cancels the stale pointer instead of leaking it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-15 10:13:33 +02:00
co-authored by Claude Opus 5.5
parent 139a845151
commit 3a62599a3f
7 changed files with 117 additions and 25 deletions
+18
View File
@@ -124,6 +124,24 @@ private Q_SLOTS:
QVERIFY(!surface->alternates()->isOpen());
}
void secondLongPressFinishesFirst()
{
const QPoint e = keyCenter(u"e"_s), u = keyCenter(u"u"_s);
auto *surface = qobject_cast<KeyboardSurface *>(keyboard);
QTest::touchEvent(&window, touchscreen).press(0, e);
QTest::qWait(LongPressWaitMs);
QTest::touchEvent(&window, touchscreen).stationary(0).press(1, u);
QTest::qWait(LongPressWaitMs); // u's popup replaces e's, which types its choice
QCOMPARE(engine.output, u"é");
QVERIFY(surface->alternates()->isOpen());
QTest::touchEvent(&window, touchscreen).release(0, e).stationary(1);
QCOMPARE(engine.output, u"é"); // the first finger's lift does nothing more
QVERIFY(surface->alternates()->isOpen());
QTest::touchEvent(&window, touchscreen).release(1, u);
QCOMPARE(engine.output.size(), 2);
QVERIFY(!surface->alternates()->isOpen());
}
void secondFingerCommitsFirst()
{
const QPoint a = keyCenter(u"a"_s), s = keyCenter(u"s"_s);