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

Chris Holland <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
Zren created this revision.
Herald added a project: KWin.
Herald added a subscriber: kwin.
Zren requested review of this revision.

REVISION SUMMARY
  Send Keyboard Events to `Dialog.children` instead of `Dialog.contentItem.children`.
  
  The only children of `contentItem` are a `Plasma::FrameSvgItem` and a `ColorScope`, and not the very important `mainItem` which is where most `Keys.onPressed` is defined.
  
  BUG: 370185
  
  -----
  
  Assuming this is backportable:
  ~~Fixed In: 5.12.7~~ (released tomorrow so too late for that)
  Fixed In: 5.12.8 (Feb 12th) <= Most likely?
  
  Fixed In: 5.14.0 (Beta was Sep 13, Tagged Oct 4, Released Oct 9) 
  Fixed In: 5.14.1 (Oct 16)
  
  -----
  
  Here's where FrameSvgItem is defined / set as a child on contentItem.
  https://github.com/KDE/plasma-framework/blob/master/src/plasmaquick/dialog.cpp#L758
  
  Here's where mainItem *should* be a child of contentItem.
  https://github.com/KDE/plasma-framework/blob/master/src/plasmaquick/dialog.cpp#L797
  
  I've no idea where ColorScope is defined as a child, but when I logged it, it had a null parent.
  
    kwin_tabbox:     d->window() PlasmaQuick::Dialog(0x15bcc30 exposed, ...)
    kwin_tabbox:     d->window()->contentItem() QQuickRootItem(0x15820e0, parent=0x0, geometry=0,0 932x206)
    kwin_tabbox:     d->window()->sendEvent Plasma::FrameSvgItem(0x15be890, parent=0x15820e0, geometry=0,0 932x206)
    kwin_tabbox:     d->window()->sendEvent ColorScope(0x16862a0, parent=0x0, geometry=0,0 0x0)
  
  Seeing as mainItem is not a child of contentItem, this could actually be a plasma-framework bug too. That said, I don't really see a need to send keyboard events to the `PlasmaCore.Dialog` background svg or the `ColorScope`.
  
  Here's what it sends to now:
  
    kwin_tabbox:     d->window() PlasmaQuick::Dialog(0x1b97d00 exposed, ...)
    kwin_tabbox:     d->window()->contentItem() QQuickRootItem(0x1b94be0, parent=0x0, geometry=0,0 932x602)
    kwin_tabbox:     d->window()->sendEvent QQuickRootItem(0x1b94be0, parent=0x0, geometry=0,0 932x602)
    kwin_tabbox:     d->window()->sendEvent QQuickItem_QML_72(0x1b99a60, parent=0x1b94be0, geometry=4,4 924x594)

TEST PLAN
  Use arrow keys with any skin that defines the key handler at `Dialog.mainItem.Keys.onPressed`. Breeze does not define a key event handler at all (so a patch to `plasma-workspace` is next).
  
  If you have the `kwin-addons` package, aka the `kdeplasma-addons` git repo (`sudo apt search kwin-addons` in Neon), you can test Large Icons. Informative does not work however.
  
  A full table of which QML skins work can be seen at this comment in the bug report:
  https://bugs.kde.org/show_bug.cgi?id=370185#c10

REPOSITORY
  R108 KWin

REVISION DETAIL
  https://phabricator.kde.org/D15720

AFFECTED FILES
  tabbox/tabboxhandler.cpp

To: Zren
Cc: kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.