From c42d1607421e900567f6f4fe2644f18afa62e2f9 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 7 Nov 2018 16:22:34 +0000 Subject: [PATCH] [TabBox] Fix Arrow Key / Keyboard Events in QML Alt+Tab Skins 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 Reviewers: #kwin, graesslin Reviewed By: #kwin, graesslin Subscribers: graesslin, kwin, Zren Tags: #kwin Differential Revision: https://phabricator.kde.org/D16693 --- tabbox/tabboxhandler.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tabbox/tabboxhandler.cpp b/tabbox/tabboxhandler.cpp index 501ef2d093..594e01c0a3 100644 --- a/tabbox/tabboxhandler.cpp +++ b/tabbox/tabboxhandler.cpp @@ -528,13 +528,7 @@ void TabBoxHandler::grabbedKeyEvent(QKeyEvent* event) const if (!d->m_mainItem || !d->window()) { return; } - const QList items = d->window()->contentItem()->findChildren(QString(), Qt::FindDirectChildrenOnly); - for (QQuickItem *item : items) { - d->window()->sendEvent(item, event); - if (event->isAccepted()) { - break; - } - } + QCoreApplication::sendEvent(d->window(), event); } bool TabBoxHandler::containsPos(const QPoint& pos) const