Skip to content

Commit 90d9703

Browse files
committed
fix(panel): mark panels dirty on window add/close
TaskBarElement was not updating when windows were created or closed at runtime because WindowStateService never notified panels. Add PanelStateService.MarkDirty() calls to AddWindow and CloseWindow.
1 parent 3e491b5 commit 90d9703

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

SharpConsoleUI/Core/WindowStateService.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,9 @@ public Window AddWindow(Window window, bool activateWindow = true)
931931

932932
window.WindowIsAdded();
933933

934+
// Notify panels that window list changed (updates taskbar, etc.)
935+
context.PanelStateService.MarkDirty();
936+
934937
_logService?.LogDebug($"Window added successfully: {window.Title}", "Window");
935938
return window;
936939
}
@@ -1039,6 +1042,9 @@ public bool CloseWindow(Window? window, bool activateParent = true, bool force =
10391042
// STEP 3: Complete the close (fire OnClosed, dispose controls)
10401043
window.CompleteClose();
10411044

1045+
// Notify panels that window list changed (updates taskbar, etc.)
1046+
context.PanelStateService.MarkDirty();
1047+
10421048
// Clear only the closed window's area (not entire screen!)
10431049
if (_renderer != null && _consoleDriver != null)
10441050
{

0 commit comments

Comments
 (0)