Focus handling fixes

Authored by hein on Oct 10 2018, 2:43 PM.


  • Fix keyboard nav on the desktop again.


  • Fix initial focus properly.
  • Make sure when using arrows after starting Plasma or after clicking into empty space, the first selected item is always 0, not 1 or some random item based on previous activity.
  • Make sure the view is always scrolled up when (re)opening the popup.

Diff Detail

R119 Plasma Desktop
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
hein created this revision.Oct 10 2018, 2:43 PM
Restricted Application added a project: Plasma. · View Herald TranscriptOct 10 2018, 2:43 PM
hein requested review of this revision.Oct 10 2018, 2:43 PM
davidedmundson accepted this revision.Oct 10 2018, 5:19 PM
davidedmundson added a subscriber: davidedmundson.
davidedmundson added inline comments.

I would have expected just folderViewLayer.forceActiveFocus() to work?

the FolderViewLayer item should be the only item within the Loader (which is a focus scope) and you added focus: true to FolderViewLayer

This revision is now accepted and ready to land.Oct 10 2018, 5:19 PM
hein added inline comments.Oct 10 2018, 5:25 PM

Maybe, but if you look at the diff, what this is replacing is indiscriminately doing root.forceActiveFocus(), which isn't good enough. root is the FolderViewDropArea, which is not a FocusScope and can't be.

... however, I added the focus-forwarding (root.onFocusChanged) in a later change - which means I can now actually clean this up again.

hein updated this revision to Diff 43329.Oct 10 2018, 5:28 PM
  • Drop the onPress handling, it was unnecessary with the focus-forwarding I added later during development.
  • Take David's review comment into account.
davidedmundson accepted this revision.Oct 11 2018, 12:14 AM
This revision was automatically updated to reflect the committed changes.