diff --git a/tabbox/tabboxhandler.cpp b/tabbox/tabboxhandler.cpp index f7927a3b55..6d77ff1a61 100644 --- a/tabbox/tabboxhandler.cpp +++ b/tabbox/tabboxhandler.cpp @@ -489,10 +489,16 @@ const QModelIndex& TabBoxHandler::currentIndex() const void TabBoxHandler::grabbedKeyEvent(QKeyEvent* event) const { - if (!d->m_mainItem) { + if (!d->m_mainItem || !d->window()) { return; } - QApplication::sendEvent(d->window(), event); + const QList items = d->window()->contentItem()->findChildren(QString(), Qt::FindDirectChildrenOnly); + for (QQuickItem *item : items) { + d->window()->sendEvent(item, event); + if (event->isAccepted()) { + break; + } + } } bool TabBoxHandler::containsPos(const QPoint& pos) const