Add accessibility and set focus on the actual items in the window switcher
ClosedPublic

Authored by gladhorn on Nov 3 2018, 4:17 PM.

Details

Summary

For accessibility reasons we want to make sure that the QQuickWindow
thinks the focus is on the correct item. This will allow screen readers
to read which window is current in the window switcher.

Test Plan

Running with accessibility inspection tools I see that the
right item has the focus with this change.

Diff Detail

Repository
R120 Plasma Workspace
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 4557
Build 4575: arc lint + arc unit
gladhorn created this revision.Nov 3 2018, 4:17 PM
Restricted Application added a project: Plasma. · View Herald TranscriptNov 3 2018, 4:17 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
gladhorn requested review of this revision.Nov 3 2018, 4:17 PM
broulik added a subscriber: broulik.Nov 3 2018, 5:02 PM
broulik added inline comments.
lookandfeel/contents/windowswitcher/WindowSwitcher.qml
47

Doesn't the focus: true imply that already?

zzag edited reviewers, added: KWin; removed: kwin.Nov 3 2018, 6:14 PM
gladhorn added inline comments.Nov 4 2018, 12:31 PM
lookandfeel/contents/windowswitcher/WindowSwitcher.qml
47

It would if the window did end up having the focus in some form. As far as I can tell it doesn't ever get the focus (since kwin decided that it shouldn't). Doing this makes qt quick focus handling work while leaving the real window focus alone.

What's with alternative window switchers? They all would need this force activation as well.

I would very much like to see a more robust and generic solution to the problem. Best would be imo to look again into activating the tabbox window on KWin level directly. That it doesn't do this is a semantic error.

lookandfeel/contents/windowswitcher/WindowSwitcher.qml
47

Solutions like this always carry the risk of regression. What if in a future Qt release the window focus gets checked before focus gets force activated?

gladhorn updated this revision to Diff 44856.Nov 4 2018, 4:32 PM

Removed Qt.X11BypassWindowManagerHint which makes everything work

Thanks for encouraging this. If anyone has any ideas why the window manager hint was set, I'd be interested to learn.

"Everything" meaning activeFocus within the window or including orca focus awareness?

zzag added a subscriber: zzag.Nov 4 2018, 4:56 PM
This comment was removed by zzag.

It looks like I need either forceActiveFocus or to remove the window manager bypass hint. Or find some other way to get the focus on the window...

gladhorn updated this revision to Diff 44925.Nov 5 2018, 5:30 PM
gladhorn retitled this revision from Handle focus in the window switcher to Set focus on the actual items in the window switcher.
gladhorn edited the summary of this revision. (Show Details)
gladhorn edited the test plan for this revision. (Show Details)
gladhorn edited reviewers, added: kwin; removed: KWin.
gladhorn removed subscribers: zzag, romangg, broulik.

After the change in KWin only this is needed

gladhorn updated this revision to Diff 44926.Nov 5 2018, 5:49 PM
gladhorn retitled this revision from Set focus on the actual items in the window switcher to Add accessibility and set focus on the actual items in the window switcher.

Changed it to be more pleasant by using client as role and set the focus on the top level, so that the geometry is also more sensible.

davidedmundson accepted this revision.Nov 5 2018, 6:27 PM
This revision is now accepted and ready to land.Nov 5 2018, 6:27 PM
gladhorn closed this revision.Nov 5 2018, 8:52 PM

This is in I'm unsure why "arc land" didn't close it.

ngraham edited projects, added Plasma Accessibility; removed Plasma.Nov 6 2018, 9:41 PM
Restricted Application edited projects, added Plasma; removed Plasma Accessibility. · View Herald TranscriptNov 6 2018, 9:41 PM
ngraham edited projects, added Plasma Accessibility; removed Plasma.Nov 6 2018, 9:41 PM
Restricted Application edited projects, added Plasma; removed Plasma Accessibility. · View Herald TranscriptNov 6 2018, 9:41 PM