[konsole] [Bug 411387] Split View crash with keyboard navigation
Nikolay Zlatev
bugzilla_noreply at kde.org
Fri Aug 30 09:38:55 BST 2019
https://bugs.kde.org/show_bug.cgi?id=411387
--- Comment #4 from Nikolay Zlatev <nik at astrapaging.com> ---
It appears this is theme related issue.
When I use Breeze everything is OK.
For Breeze
const auto handleWidth = parentSplitter->handleWidth() <= 1 ? 4 :
parentSplitter->handleWidth();
returns 4 as a constant.
For Kvantum -> Adpata
parentSplitter->handleWidth() is used (4 pixels again, but this is the width of
the splitter border)
then
topSplitter->childAt(newPoint) returns ViewSplitter instead of TerminalDisplay
This fixes issue for me
const auto handleWidth = parentSplitter->handleWidth() <= 1 ? 4 :
parentSplitter->handleWidth() + 1;
----------------------------------------------------------------------
diff --git a/src/ViewSplitter.cpp b/src/ViewSplitter.cpp
index 7e31172c..24b49334 100644
--- a/src/ViewSplitter.cpp
+++ b/src/ViewSplitter.cpp
@@ -147,7 +147,7 @@ void ViewSplitter::handleFocusDirection(Qt::Orientation
orientation, int directi
auto parentSplitter =
qobject_cast<ViewSplitter*>(terminalDisplay->parentWidget());
auto topSplitter = parentSplitter->getToplevelSplitter();
- const auto handleWidth = parentSplitter->handleWidth() <= 1 ? 4 :
parentSplitter->handleWidth();
+ const auto handleWidth = parentSplitter->handleWidth() <= 1 ? 4 :
parentSplitter->handleWidth() + 1;
const auto start = QPoint(terminalDisplay->x(), terminalDisplay->y());
const auto startMapped = parentSplitter->mapTo(topSplitter, start);
@@ -168,7 +168,8 @@ void ViewSplitter::handleFocusDirection(Qt::Orientation
orientation, int directi
} else if (qobject_cast<QSplitterHandle*>(child) != nullptr) {
auto targetSplitter = qobject_cast<QSplitter*>(child->parent());
auto splitterTerminal =
qobject_cast<TerminalDisplay*>(targetSplitter->widget(0));
- splitterTerminal->setFocus(Qt::OtherFocusReason);
+ if (splitterTerminal != nullptr)
+ splitterTerminal->setFocus(Qt::OtherFocusReason);
} else if (qobject_cast<QWidget*>(child) != nullptr) {
TerminalDisplay *terminalParent = nullptr;
while(terminalParent == nullptr) {
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the konsole-devel
mailing list