Bug 455099

Summary: Switching focus away from the search bar with down arrow key highlights nothing on first keypress; second one highlights a window
Product: [Plasma] kwin Reporter: Ilya Bizyaev <bizyaev>
Component: effects-present-windowsAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: kde, nate, notify, notmart, wolfendeathx
Priority: NOR Keywords: usability
Version: 5.24.90   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 5.25.2
Sentry Crash Report:
Attachments: This is how the keyboard functionality of the new effect works and looks

Description Ilya Bizyaev 2022-06-09 19:53:40 UTC
(split out of https://bugs.kde.org/show_bug.cgi?id=454842)

When the effect is triggered with a shortcut (Ctrl-F9 here), it's the search bar that is highlighted, and pressing the down arrow to choose the first window makes the highlight just vanish. Pressing Enter does nothing. Further arrow presses actually select windows.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Leap 15.4
KDE Plasma Version: 5.24.90
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.2
Graphics Platform: X11
Graphics Processor: Mesa Intel® UHD Graphics

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2022-06-10 14:38:39 UTC
Can reproduce.
Comment 2 Niklas Stephanblome 2022-06-22 11:27:52 UTC
I fixed this and the merge request will hopefully soon be merged. With this change, there will ALWAYS be one window highlighted while using the keyboard. One can also easily change the selection with the arrow keys at any time, even while typing in the searchbox. 

Here it is: https://invent.kde.org/plasma/kwin/-/merge_requests/2562
Comment 3 Mark S 2022-06-22 19:44:33 UTC
(In reply to Niklas Stephanblome from comment #2)
> I fixed this and the merge request will hopefully soon be merged. With this
> change, there will ALWAYS be one window highlighted while using the
> keyboard. One can also easily change the selection with the arrow keys at
> any time, even while typing in the searchbox. 
> 
> Here it is: https://invent.kde.org/plasma/kwin/-/merge_requests/2562

I noticed on line 78 the auto focus of the search field was set to false as the fix for this. Unless I'm mistaken, this will mean clicking on the search field to focus it before typing, instead of just immediately typing once the Present Windows effect is opened. Is there an alternative workaround for this? If I am mistaken, this can be ignored.

I ask because I navigate this effect almost exclusively by opening it, immediately typing, then hitting enter (this last part also appears to now be broken, I'll file a separate bug).
Comment 4 Niklas Stephanblome 2022-06-22 19:49:29 UTC
(In reply to Mark S from comment #3)
> (In reply to Niklas Stephanblome from comment #2)
> > I fixed this and the merge request will hopefully soon be merged. With this
> > change, there will ALWAYS be one window highlighted while using the
> > keyboard. One can also easily change the selection with the arrow keys at
> > any time, even while typing in the searchbox. 
> > 
> > Here it is: https://invent.kde.org/plasma/kwin/-/merge_requests/2562
> 
> I noticed on line 78 the auto focus of the search field was set to false as
> the fix for this. Unless I'm mistaken, this will mean clicking on the search
> field to focus it before typing, instead of just immediately typing once the
> Present Windows effect is opened. Is there an alternative workaround for
> this? If I am mistaken, this can be ignored.
> 
> I ask because I navigate this effect almost exclusively by opening it,
> immediately typing, then hitting enter (this last part also appears to now
> be broken, I'll file a separate bug).

No worries, I thought of this already. All the keys are forwarded to the search field automatically, which means you can start typing anytime and whenever you want, it will still all be seen by the searchfield.
Comment 5 Niklas Stephanblome 2022-06-22 19:53:20 UTC
> (this last part also appears to now
> be broken, I'll file a separate bug).

And you don't need to file a bug for this, this is all part of the merge request. This merge request restores the ENTIRE keyboard functionality of the old presentwindows effect. You search for something, hit enter, it's opened. You search for something, right arrow key to change the selection, enter, it's opened.
Comment 6 Niklas Stephanblome 2022-06-22 20:23:03 UTC
Created attachment 150067 [details]
This is how the keyboard functionality of the new effect works and looks

As there was some confusion as to what works and what not with the merge request, I added a (shitty quality because of upload size limit) video of me demonstrating that it works just like presentwindows.
Comment 7 Nate Graham 2022-06-23 17:14:19 UTC
Git commit 6838b1132fad8b32c26409fd46b2e49803684dd6 by Nate Graham, on behalf of Niklas Stephanblom.
Committed on 23/06/2022 at 17:13.
Pushed by ngraham into branch 'master'.

Windowview: Fix broken keyboard navigation while filtering

After the 5.25 update, one could not see which window was highlighted until one
manually unfocused the SearchField and then pressed any key to refresh the WindowHeap.
Also, the searchbar would (most of the time) "absorb" the arrow keys so one had to
also unfocus it to really be able to select windows with they keyboard. 

With this change, there is always one window highlighted while filtering using the
search box. Also, one can select another window with the arrow keys without manually
unfocusing the searchbox. This heavily improves the keyboard functionality in this
effect that got lost with the 5.25 update of presentwindows to windowview and
resolves complaints about the keyboard navigation being buggy. 
Related: bug 455633, bug 455764, bug 455586, bug 455753
FIXED-IN: 5.25.2

M  +6    -2    src/effects/windowview/qml/main.qml
M  +3    -0    src/effects/windowview/windowvieweffect.cpp

https://invent.kde.org/plasma/kwin/commit/6838b1132fad8b32c26409fd46b2e49803684dd6
Comment 8 Nate Graham 2022-06-23 17:16:41 UTC
Git commit dcc77bfa8fbca8032047fbbb5ab65382293488ac by Nate Graham, on behalf of Niklas Stephanblom.
Committed on 23/06/2022 at 17:16.
Pushed by ngraham into branch 'Plasma/5.25'.

Windowview: Fix broken keyboard navigation while filtering

After the 5.25 update, one could not see which window was highlighted until one
manually unfocused the SearchField and then pressed any key to refresh the WindowHeap.
Also, the searchbar would (most of the time) "absorb" the arrow keys so one had to
also unfocus it to really be able to select windows with they keyboard. 

With this change, there is always one window highlighted while filtering using the
search box. Also, one can select another window with the arrow keys without manually
unfocusing the searchbox. This heavily improves the keyboard functionality in this
effect that got lost with the 5.25 update of presentwindows to windowview and
resolves complaints about the keyboard navigation being buggy. 
Related: bug 455633, bug 455764, bug 455586, bug 455753
FIXED-IN: 5.25.2


(cherry picked from commit 6838b1132fad8b32c26409fd46b2e49803684dd6)

M  +6    -2    src/effects/windowview/qml/main.qml
M  +3    -0    src/effects/windowview/windowvieweffect.cpp

https://invent.kde.org/plasma/kwin/commit/dcc77bfa8fbca8032047fbbb5ab65382293488ac