Skip to content

Commit 898179b

Browse files
Merge pull request #640 from Macro-Deck-App/fix/empty-deck-on-tray-restore
Fix empty deck when restoring main window from tray
2 parents 4c8c406 + 19ec8ee commit 898179b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/MacroDeck/GUI/MainWindowViews/DeckView.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,14 @@ public void UpdateButtons(bool clear = false)
147147
return;
148148
}
149149

150+
// While the window is minimized the button panel collapses to a zero size, which would make
151+
// the computed button size negative and render the deck empty. Skip the layout in that case;
152+
// it runs again once the window is restored to a usable size.
153+
if (buttonPanel.Width <= 0 || buttonPanel.Height <= 0)
154+
{
155+
return;
156+
}
157+
150158
if (clear)
151159
{
152160
foreach (RoundedButton roundedButton in buttonPanel.Controls)

0 commit comments

Comments
 (0)