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
MouseArea {
anchors.fill: parent
hoverEnabled: true
acceptedButtons: Qt.NoButton
propagateComposedEvents: true
onPositionChanged: {
sloppyTimer.restart()
}
onExited: {
sloppyTimer.stop()
// Sloppy focus — focus prompt when mouse hovers inside pane
HoverHandler {
id: sloppyHover
onHoveredChanged: {
if (hovered) {
sloppyTimer.restart()
} else {
sloppyTimer.stop()
}
}
}
Timer {
id: sloppyTimer
interval: 100
interval: 300
onTriggered: {
paneRoot.focus = true
panePrompt.forceActiveFocus()
if (!panePrompt.activeFocus) {
paneRoot.focus = true
panePrompt.forceActiveFocus()
}
}
}