Watch
1
0
Fork
You've already forked souveraine
0

drawer: the keyboard comes up on a tap, not on a press

Summoning on onPressed meant any gesture that merely began over the search
field raised the keyboard — including the swipe that scrolls the app grid,
which starts at the top of the drawer more often than not. The press now only
remembers where it landed and the release decides, with a generous slop: a
thumb reaching the top of a 540px panel is not steady, and a few pixels of
drift while tapping a text field is a tap.
This commit is contained in:
Fimeg 2026-08-07 02:22:28 -04:00
commit f4caaae1cb

View file

@ -419,8 +419,33 @@ Scope {
height: searchWidget.height
acceptedButtons: Qt.LeftButton
propagateComposedEvents: true
// A tap, not a press.
//
// Summoning on `onPressed` meant any gesture that merely *began*
// over the search field raised the keyboard including the swipe
// that scrolls the app grid, which starts at the top of the drawer
// more often than not. Casey, 2026-08-07: "keyboard still opens
// when I swipe on the app drawer."
//
// So the press only remembers where it landed and the release
// decides. The slop is deliberately generous: a thumb reaching the
// top of a 540px panel is not steady, and a few pixels of drift
// while tapping a text field is a tap.
property real pressX: 0
property real pressY: 0
readonly property real tapSlop: 12
onPressed: (mouse) => {
if (!GlobalStates.oskOpen) {
oskSummoner.pressX = mouse.x;
oskSummoner.pressY = mouse.y;
mouse.accepted = false;
}
onReleased: (mouse) => {
const moved = Math.hypot(mouse.x - oskSummoner.pressX,
mouse.y - oskSummoner.pressY);
if (moved <= oskSummoner.tapSlop && !GlobalStates.oskOpen) {
searchWidget.focusSearchInput();
GlobalStates.oskOpen = true;
}