From 8f7fc8129b526a10269525a1da6e2241e8e3d5df Mon Sep 17 00:00:00 2001 From: BDisp Date: Wed, 15 Mar 2023 19:14:26 +0000 Subject: [PATCH] Fixes #2416. Single smaller top level leaves chunk trails on move. --- Terminal.Gui/Core/Application.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Terminal.Gui/Core/Application.cs b/Terminal.Gui/Core/Application.cs index a646cbddb..e70570d9f 100644 --- a/Terminal.Gui/Core/Application.cs +++ b/Terminal.Gui/Core/Application.cs @@ -1241,6 +1241,14 @@ namespace Terminal.Gui { } state.Toplevel.SetNeedsDisplay (state.Toplevel.Bounds); } + if (toplevels.Count == 1 && state.Toplevel == Top + && (Driver.Cols != state.Toplevel.Frame.Width || Driver.Rows != state.Toplevel.Frame.Height) + && (!state.Toplevel.NeedDisplay.IsEmpty || state.Toplevel.ChildNeedsDisplay || state.Toplevel.LayoutNeeded)) { + + Driver.SetAttribute (Colors.TopLevel.Normal); + state.Toplevel.Clear (new Rect (0, 0, Driver.Cols, Driver.Rows)); + + } if (!state.Toplevel.NeedDisplay.IsEmpty || state.Toplevel.ChildNeedsDisplay || state.Toplevel.LayoutNeeded || MdiChildNeedsDisplay ()) { state.Toplevel.Redraw (state.Toplevel.Bounds);