Commit a77f75bf authored by Mariusz Glebocki's avatar Mariusz Glebocki Committed by Kurt Hindenburg
Browse files

activeTerminalDisplay(): find parent TD if needed

parent f8d8c3aa
......@@ -203,8 +203,17 @@ void ViewSplitter::focusRight()
TerminalDisplay *ViewSplitter::activeTerminalDisplay() const
{
auto focusedWidget = qobject_cast<TerminalDisplay*>(focusWidget());
return focusedWidget != nullptr ? focusedWidget : findChild<TerminalDisplay*>();
auto focusedWidget = focusWidget();
auto focusedTerminalDisplay = qobject_cast<TerminalDisplay*>(focusedWidget);
// TD's child can be focused - try to find parent.
while (focusedTerminalDisplay == nullptr && focusedWidget != nullptr && focusedWidget != this) {
focusedWidget = focusedWidget->parentWidget();
focusedTerminalDisplay = qobject_cast<TerminalDisplay*>(focusedWidget);
}
return focusedTerminalDisplay != nullptr ? focusedTerminalDisplay
: findChild<TerminalDisplay*>();
}
void ViewSplitter::toggleMaximizeCurrentTerminal()
......
Markdown is supported
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