https://bugs.kde.org/show_bug.cgi?id=520266
Bug ID: 520266
Summary: Search field loses focus on first keystroke when mouse
is over a result item
Classification: Plasma
Product: plasmashell
Version First 6.4.2
Reported In:
Platform: openSUSE
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: Application Launcher (Kickoff) widget
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Target Milestone: 1.0
STEPS TO REPRODUCE
1. Position mouse cursor in the center area where search results will appear
2. Press Meta key to open Kickoff
3. Type a single letter (e.g., "F")
4. Notice the search field has lost focus - subsequent keystrokes are ignored
OBSERVED RESULT
The search field loses keyboard focus as soon as the search results list
appears. The item under the mouse cursor receives forceActiveFocus(), stealing
focus from the text field. Any further keystrokes are not registered — the
user must click the text field with the mouse to regain focus.
EXPECTED RESULT
Keyboard focus should remain in the search text field while typing, regardless
of where the mouse cursor is positioned. Hover should not steal focus from the
search field during active text input.
TECHNICAL ROOT CAUSE
In FullRepresentation.qml, the onSearchTextChanged handler has a logic gap:
When the first keystroke triggers a transition from NormalPage to searchView
(currentItem.objectName !== "searchView"), the code calls:
contentItemStackView.replace(searchViewComponent)
...but does NOT set root.blockingHoverFocus = true beforehand.
blockingHoverFocus is only set to true in the else branch (when the searchView
is already active, i.e., on subsequent keystrokes).
Because blockingHoverFocus remains false during the initial view replacement,
the MouseArea in AbstractKickoffItemDelegate.qml has hoverEnabled: true
(since !kickoff.fullRepresentationItem.blockingHoverFocus is true). As the
search result delegate items are created, if the mouse is already positioned
over where a result appears, onEntered fires, calling
forceActiveFocus(Qt.MouseFocusReason) on the result item, which steals focus
from the search text field.
SUGGESTED FIX
Add root.blockingHoverFocus = true BEFORE contentItemStackView.replace()
in the first branch of onSearchTextChanged in FullRepresentation.qml:
} else if (root.header.searchText.length > 0) {
if (contentItemStackView.currentItem.objectName !== "searchView") {
+ root.blockingHoverFocus = true
contentItemStackView.reverseTransitions = false
contentItemStackView.replace(searchViewComponent)
} else {
SOFTWARE/OS VERSIONS
Linux Distribution: openSUSE Leap 16.0
KDE Plasma Version: 6.4.2
KDE Frameworks Version: 6.16.0
Qt Version: 6.9.1
Kernel Version: 6.12.0-160000.30-default
Graphics Platform: Wayland
--
You are receiving this mail because:
You are watching all bug changes.