Background
PR #2576 centralized frameless title-bar move handling in FramelessMoveHelper, migrating 6+ frameless title bars to a consistent macOS/Linux/Windows pattern. One call site was deliberately left out of that refactor and is worth a small follow-up.
The site
src/gui/containers/ContainerWidget.cpp:144-158:
void ContainerWidget::onTitleBarDragStart(const QPoint& /*globalPos*/)
{
if (!m_titleBar) return;
if (m_dockMode == DockMode::Floating) {
if (auto* w = window()) {
if (auto* h = w->windowHandle()) {
h->startSystemMove(); // ← unguarded, no fallback, no Q_OS_MAC skip
return;
}
}
}
// ... drag-to-reorder QDrag path follows
}
This is the same startSystemMove() pattern PR #2576 removed everywhere else, with two differences:
- No
Q_OS_MAC guard — would re-introduce the macOS 5–10 second dead-zone bug if the line ever fires
- No return-value check or fallback — if
startSystemMove() refuses, the user gets no movement at all
Currently unreachable, but worth fixing anyway
Tracing the state machine after #2576:
ContainerTitleBar::mousePressEvent early-returns when m_isFloating == true and never sets m_pressed
mouseMoveEvent short-circuits without emitting dragStartRequested when m_pressed is false
- So
ContainerWidget::onTitleBarDragStart is only reachable in the docked (non-floating) state, where m_dockMode == DockMode::Floating is false and the startSystemMove() branch is skipped
That makes the call effectively dead code right now. But: if a future refactor lets ContainerTitleBar::m_isFloating and ContainerWidget::m_dockMode == DockMode::Floating desync, that line would resurface and reproduce the macOS bug class that #2576 just fixed.
Suggested fix
Two reasonable options:
(a) Delete the dead branch. Simplest. The early-return logic in ContainerTitleBar makes it unreachable, and if floating-mode container drag ever gets re-enabled it should go through FramelessMoveHelper not startSystemMove.
void ContainerWidget::onTitleBarDragStart(const QPoint&)
{
if (!m_titleBar) return;
// (drag-to-reorder QDrag path follows)
}
(b) Route through FramelessMoveHelper. Preserves the floating-mode branch but routes it through the centralized helper so the macOS skip + manual fallback behavior is consistent with every other title bar.
I'd lean (a) — dead code carries no value, and if the feature comes back the helper integration is a one-liner at that point.
Context
73, Jeremy KK7GWY & Claude (AI dev partner)
Background
PR #2576 centralized frameless title-bar move handling in
FramelessMoveHelper, migrating 6+ frameless title bars to a consistent macOS/Linux/Windows pattern. One call site was deliberately left out of that refactor and is worth a small follow-up.The site
src/gui/containers/ContainerWidget.cpp:144-158:This is the same
startSystemMove()pattern PR #2576 removed everywhere else, with two differences:Q_OS_MACguard — would re-introduce the macOS 5–10 second dead-zone bug if the line ever firesstartSystemMove()refuses, the user gets no movement at allCurrently unreachable, but worth fixing anyway
Tracing the state machine after #2576:
ContainerTitleBar::mousePressEventearly-returns whenm_isFloating == trueand never setsm_pressedmouseMoveEventshort-circuits without emittingdragStartRequestedwhenm_pressedis falseContainerWidget::onTitleBarDragStartis only reachable in the docked (non-floating) state, wherem_dockMode == DockMode::Floatingis false and thestartSystemMove()branch is skippedThat makes the call effectively dead code right now. But: if a future refactor lets
ContainerTitleBar::m_isFloatingandContainerWidget::m_dockMode == DockMode::Floatingdesync, that line would resurface and reproduce the macOS bug class that #2576 just fixed.Suggested fix
Two reasonable options:
(a) Delete the dead branch. Simplest. The early-return logic in
ContainerTitleBarmakes it unreachable, and if floating-mode container drag ever gets re-enabled it should go throughFramelessMoveHelpernotstartSystemMove.(b) Route through
FramelessMoveHelper. Preserves the floating-mode branch but routes it through the centralized helper so the macOS skip + manual fallback behavior is consistent with every other title bar.I'd lean (a) — dead code carries no value, and if the feature comes back the helper integration is a one-liner at that point.
Context
feedback_pr_stale_code_check.mdguidance73, Jeremy KK7GWY & Claude (AI dev partner)