From 825adfcf2f4afc5006fcccb144f837524b836a26 Mon Sep 17 00:00:00 2001 From: casey langen Date: Sun, 18 Jul 2021 13:59:29 -0700 Subject: [PATCH] Fix view re-creation due to visibility change. --- src/musikcube/app/layout/LyricsLayout.cpp | 1 - src/musikcube/cursespp/Window.cpp | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/musikcube/app/layout/LyricsLayout.cpp b/src/musikcube/app/layout/LyricsLayout.cpp index ce559cf9e..b9c35d99a 100644 --- a/src/musikcube/app/layout/LyricsLayout.cpp +++ b/src/musikcube/app/layout/LyricsLayout.cpp @@ -128,7 +128,6 @@ bool LyricsLayout::KeyPress(const std::string& kn) { void LyricsLayout::OnVisibilityChanged(bool visible) { LayoutBase::OnVisibilityChanged(visible); if (visible) { - this->SetState(this->state); this->LoadLyricsForCurrentTrack(); this->FocusFirst(); } diff --git a/src/musikcube/cursespp/Window.cpp b/src/musikcube/cursespp/Window.cpp index 4165345b5..4a6d846fa 100755 --- a/src/musikcube/cursespp/Window.cpp +++ b/src/musikcube/cursespp/Window.cpp @@ -327,7 +327,9 @@ void Window::MoveAndResize(int x, int y, int width, int height) { this->lastAbsoluteY = absY; this->width = width; this->height = height; - this->RecreateForUpdatedDimensions(); + if (this->isVisibleInParent) { + this->RecreateForUpdatedDimensions(); + } } else { this->DestroyIfBadBounds(); @@ -616,7 +618,7 @@ void Window::Show() { } } else { - this->Create(); + this->RecreateForUpdatedDimensions(); this->isVisibleInParent = true; }