Commit bad07cde authored by Fushan Wen's avatar Fushan Wen 💬 Committed by Nate Graham
Browse files

shell: move keyboard focus code from frontend to backend

It makes the code easier to be maintained across different platforms.

CCBUG: 453166
CCBUG: 352476
parent 19084358
......@@ -265,18 +265,18 @@ void ShellCorona::init()
return;
}
PanelView *activePanel = qobject_cast<PanelView *>(qGuiApp->focusWindow());
Plasma::Containment *containmentToActivate = nullptr;
if (activePanel) {
auto it = m_panelViews.constFind(activePanel->containment());
it++;
if (it != m_panelViews.constEnd()) {
containmentToActivate = it.value()->containment();
}
if (!activePanel) {
activePanel = m_panelViews.values().first();
}
if (!containmentToActivate) {
containmentToActivate = m_panelViews.values().first()->containment();
if (activePanel->containment()->status() != Plasma::Types::AcceptingInputStatus) {
activePanel->containment()->setStatus(Plasma::Types::AcceptingInputStatus);
auto nextItem = activePanel->rootObject()->nextItemInFocusChain();
if (nextItem) {
nextItem->forceActiveFocus();
}
}
emit containmentToActivate->activated();
});
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment