[TabBox] Fix Arrow Key / Keyboard Events in QML Alt+Tab Skins
ClosedPublic

Authored by davidedmundson on Nov 5 2018, 6:59 PM.

Details

Summary

KWin used to do a quirky trick to send key events to the topmost QQuickItem
rather than things going to the activeFocus item.

Sending it to the window previously would have failed as the window
didn't think it was active.

Since 66986d4afddcd09c28fe3addb0caa09279eda10f we can just let the
window process the events in a normal QtQuick manner.

BUG: 370185
Fixed-in: 5.15.0

It will require tabboxes to set focus correctly.
The ones I tested did.

Most analysis for this patch was done by Chris Holland.

Test Plan

Held+alt tab with the "Text" tabbox switcher
pressed up and down

Diff Detail

Repository
R108 KWin
Branch
master
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 4605
Build 4623: arc lint + arc unit
davidedmundson created this revision.Nov 5 2018, 6:59 PM
Restricted Application added a project: KWin. · View Herald TranscriptNov 5 2018, 6:59 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Nov 5 2018, 6:59 PM
graesslin accepted this revision.Nov 6 2018, 5:15 PM
graesslin added a subscriber: graesslin.

Cool! So this waa the reason why I needed those hacks...

This revision is now accepted and ready to land.Nov 6 2018, 5:15 PM
Zren added a comment.Nov 6 2018, 8:25 PM

Oh awesome. This code seems much easier to read than D15720.

Testing a few of the skins listed in https://bugs.kde.org/show_bug.cgi?id=370185#c10

  • Breeze (Look and Feel)
    • Works?! I guess the ListView handles the key input?
    • KeyHandler: None (handled by the ListView)?!
  • Small Icons, Big Icons, Text Only, Compact, Grid, Compact, Thumbnails
    • Works!
    • KeyHandler: Dialog.mainItem.Keys.onPressed
  • Informative
    • Does not work!, Seems I still need to submit D16093
    • KeyHandler: Dialog.Keys.onPressed
  • Thumbnail Grid
    • Needs updating It didn't work right away. I needed to add Dialog.mainItem.focus = true for it to work.
    • KeyHandler: Dialog.mainItem.Keys.onPressed
This revision was automatically updated to reflect the committed changes.