From 837ab00ec5d9200ba7f58d44729e0fdd50d36d40 Mon Sep 17 00:00:00 2001 From: Thomas Wilshaw Date: Thu, 15 Apr 2021 20:17:29 +0100 Subject: [PATCH 1/2] TimelineWidget: catch hand tool double click The hand tool does not inherit from TimelineTool (it is a special program wide tool) so tools_[olive::Tool::kHand] is a nullptr. Therefore when ViewMouseDoubleClicked is called we check if the hand tool is selected and simply return if it is. Fixes #1577 --- app/widget/timelinewidget/timelinewidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/widget/timelinewidget/timelinewidget.cpp b/app/widget/timelinewidget/timelinewidget.cpp index 520a21c5e..a78fa96ac 100644 --- a/app/widget/timelinewidget/timelinewidget.cpp +++ b/app/widget/timelinewidget/timelinewidget.cpp @@ -807,6 +807,10 @@ void TimelineWidget::ViewMouseReleased(TimelineViewMouseEvent *event) void TimelineWidget::ViewMouseDoubleClicked(TimelineViewMouseEvent *event) { + // kHand tool is handled differently to the other tools + if (Core::instance()->tool() == olive::Tool::kHand) { + return; + } if (GetConnectedNode()) { GetActiveTool()->MouseDoubleClick(event); UpdateViewports(); From 1b4fd56803c87684f868b1d8a17adf38cde92109 Mon Sep 17 00:00:00 2001 From: Thomas Wilshaw Date: Fri, 16 Apr 2021 20:27:44 +0100 Subject: [PATCH 2/2] timelinewidget: Catch any nullptr, not just kHand --- app/widget/timelinewidget/timelinewidget.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/widget/timelinewidget/timelinewidget.cpp b/app/widget/timelinewidget/timelinewidget.cpp index a78fa96ac..cacf96ccf 100644 --- a/app/widget/timelinewidget/timelinewidget.cpp +++ b/app/widget/timelinewidget/timelinewidget.cpp @@ -807,8 +807,10 @@ void TimelineWidget::ViewMouseReleased(TimelineViewMouseEvent *event) void TimelineWidget::ViewMouseDoubleClicked(TimelineViewMouseEvent *event) { - // kHand tool is handled differently to the other tools - if (Core::instance()->tool() == olive::Tool::kHand) { + // kHand tool will return nullptr + if (!GetActiveTool()) { + // Only kHand should return a nullptr + Q_ASSERT(Core::instance()->tool() == olive::Tool::kHand); return; } if (GetConnectedNode()) {