From 767eeec8cb0d90c2271b50573393bf85aba35fad Mon Sep 17 00:00:00 2001 From: BDisp Date: Wed, 3 Jun 2020 19:10:00 +0100 Subject: [PATCH 1/2] Fixes #604 Toplevel repaint. --- Terminal.Gui/Core/Toplevel.cs | 2 +- Terminal.Gui/Core/Window.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Terminal.Gui/Core/Toplevel.cs b/Terminal.Gui/Core/Toplevel.cs index 4e2c6ca1d..bb647bf21 100644 --- a/Terminal.Gui/Core/Toplevel.cs +++ b/Terminal.Gui/Core/Toplevel.cs @@ -264,7 +264,7 @@ namespace Terminal.Gui { if (IsCurrentTop || this == Application.Top) { if (NeedDisplay != null && !NeedDisplay.IsEmpty) { Driver.SetAttribute (Colors.TopLevel.Normal); - Clear (Frame); + Clear (bounds); Driver.SetAttribute (Colors.Base.Normal); } foreach (var view in Subviews) { diff --git a/Terminal.Gui/Core/Window.cs b/Terminal.Gui/Core/Window.cs index 37184cbf0..462bb24ad 100644 --- a/Terminal.Gui/Core/Window.cs +++ b/Terminal.Gui/Core/Window.cs @@ -201,7 +201,7 @@ namespace Terminal.Gui { if (dragPosition.HasValue) { if (SuperView == null) { Application.Top.SetNeedsDisplay (Frame); - Application.Top.Redraw (Bounds); + Application.Top.Redraw (Frame); } else { SuperView.SetNeedsDisplay (Frame); } From 020d43f8c5020c22f91e4215cae794ab38cbc4e3 Mon Sep 17 00:00:00 2001 From: BDisp Date: Wed, 3 Jun 2020 21:50:27 +0100 Subject: [PATCH 2/2] Added a comment as suggested. --- Terminal.Gui/Core/Window.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Terminal.Gui/Core/Window.cs b/Terminal.Gui/Core/Window.cs index 462bb24ad..919204171 100644 --- a/Terminal.Gui/Core/Window.cs +++ b/Terminal.Gui/Core/Window.cs @@ -201,6 +201,9 @@ namespace Terminal.Gui { if (dragPosition.HasValue) { if (SuperView == null) { Application.Top.SetNeedsDisplay (Frame); + // Redraw the entire app window using just our Frame. Since we are + // Application.Top, and our Frame always == our Bounds (Location is always (0,0)) + // our Frame is actually view-relative (which is what Redraw takes). Application.Top.Redraw (Frame); } else { SuperView.SetNeedsDisplay (Frame);