gui: fix buttons not responding on first click

Replace full-pane MouseArea sloppy focus with HoverHandler which
does not interfere with click event delivery. Also increase timer
to 300ms and guard against redundant forceActiveFocus() calls.
This commit is contained in:
Levi Neely 2026-07-18 18:32:13 +02:00
parent 7703d06430
commit 513029005e
1 changed files with 14 additions and 14 deletions

View File

@ -490,25 +490,25 @@ Item {
// Sloppy focus — focus when mouse stops moving inside pane // Sloppy focus — focus prompt when mouse hovers inside pane
MouseArea { HoverHandler {
anchors.fill: parent id: sloppyHover
hoverEnabled: true onHoveredChanged: {
acceptedButtons: Qt.NoButton if (hovered) {
propagateComposedEvents: true sloppyTimer.restart()
onPositionChanged: { } else {
sloppyTimer.restart() sloppyTimer.stop()
} }
onExited: {
sloppyTimer.stop()
} }
} }
Timer { Timer {
id: sloppyTimer id: sloppyTimer
interval: 100 interval: 300
onTriggered: { onTriggered: {
paneRoot.focus = true if (!panePrompt.activeFocus) {
panePrompt.forceActiveFocus() paneRoot.focus = true
panePrompt.forceActiveFocus()
}
} }
} }