From 306c682112ba8855df08618e41a5a3524e2ee954 Mon Sep 17 00:00:00 2001 From: ispyisail Date: Tue, 6 Oct 2026 22:02:11 +1300 Subject: [PATCH] Fix the free terminal table staying empty after a move (#1306) In the terminal strip manager, after a free terminal was moved into a strip, clicking another free terminal showed nothing on the right. It only came back after selecting a strip first. The tree remembers whether a free terminal is selected and only tells the window to update when that, or the selected strip, changes. Moving a terminal rebuilds the tree, which clears the selection and shows the empty page, but the "free terminal selected" flag stayed true. The next click on a free terminal then looked like no change and was ignored. The flag is now reset when the selection is cleared, and updated on every change it takes part in. Co-Authored-By: Claude Opus 5.5 --- .../TerminalStrip/ui/terminalstriptreedockwidget.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sources/TerminalStrip/ui/terminalstriptreedockwidget.cpp b/sources/TerminalStrip/ui/terminalstriptreedockwidget.cpp index 2611ee5b8..a4c3576a8 100644 --- a/sources/TerminalStrip/ui/terminalstriptreedockwidget.cpp +++ b/sources/TerminalStrip/ui/terminalstriptreedockwidget.cpp @@ -205,6 +205,7 @@ void TerminalStripTreeDockWidget::on_m_tree_view_currentItemChanged(QTreeWidgetI Q_UNUSED(previous) if (!current) { + m_current_is_free_terminal = false; setCurrentStrip(nullptr); return; } @@ -225,11 +226,12 @@ void TerminalStripTreeDockWidget::on_m_tree_view_currentItemChanged(QTreeWidgetI } } - if (strip_ != m_current_strip) { - setCurrentStrip(strip_); - } else if (current_is_free != m_current_is_free_terminal) { + //The flag must follow every selection change, or a reload of the tree + //(e.g. after moving a free terminal) leaves it stale and the next + //click on a free terminal shows nothing (#1306) + if (strip_ != m_current_strip || current_is_free != m_current_is_free_terminal) { m_current_is_free_terminal = current_is_free; - emit currentStripChanged(nullptr); + setCurrentStrip(strip_); } }