From 7e7143a0557434a343266b8a88de0256c864ce6f Mon Sep 17 00:00:00 2001 From: daniel-c-harvey Date: Tue, 28 Jul 2026 06:19:32 -0400 Subject: [PATCH] fix(bank_panel): repaint footer mode toggle when Design/Arrange action fires --- src/actions.cpp | 2 ++ src/bank_panel.cpp | 4 ++++ src/bank_panel.h | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/src/actions.cpp b/src/actions.cpp index be69618..f6cfa70 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -251,6 +251,7 @@ void doToggleMode() { if (target.empty()) return; // no modes to cycle to (degenerate) applyMode(g_session->view(), target, nullptr); persistViewState(); + bankPanelInvalidate(); // repaint the footer [Arrange|Design] toggle immediately } // Direct jump to a named mode. applyMode is a no-op (returns false, no mutation) if @@ -258,6 +259,7 @@ void doToggleMode() { void doActivateMode(const std::string& modeId) { applyMode(g_session->view(), modeId, nullptr); persistViewState(); + bankPanelInvalidate(); // repaint the footer [Arrange|Design] toggle immediately } // Tag the selection's leaves into `modeId`, then reapply so the change is immediate. diff --git a/src/bank_panel.cpp b/src/bank_panel.cpp index 64a64c7..cc62b9f 100644 --- a/src/bank_panel.cpp +++ b/src/bank_panel.cpp @@ -3435,6 +3435,10 @@ void bankPanelToggledBanksFullHeight() { setFullHeight(BankPanelFullHeight::BanksOnly); } +void bankPanelInvalidate() { + if (g_panel.hwnd) InvalidateRect(g_panel.hwnd, nullptr, FALSE); +} + void bankPanelShutdown() { closePanel(); deinitPreview(); diff --git a/src/bank_panel.h b/src/bank_panel.h index e2b9db2..8a3b5c8 100644 --- a/src/bank_panel.h +++ b/src/bank_panel.h @@ -117,6 +117,12 @@ void bankPanelToggledPoolFullHeight(); // Bound to the "banks full-height" action. Requests a repaint. void bankPanelToggledBanksFullHeight(); +// Requests an immediate repaint of the panel if it is open. A no-op when the panel +// is closed (safe to call unconditionally). Called by the actions layer after a +// mode change so the footer [Arrange|Design] toggle reflects the new mode without +// requiring a hide/reshow. +void bankPanelInvalidate(); + // Tears the panel down on extension unload: destroys the window and releases any // cached thumbnails / PCM handles. Mirror of bankPanelInit; safe if never opened. void bankPanelShutdown();