Browse Source

Merge pull request #605 from BDisp/toplevel-repaint

Fixes #604 Toplevel repaint.
Charlie Kindel 5 years ago
parent
commit
6631a0f266
2 changed files with 5 additions and 2 deletions
  1. 1 1
      Terminal.Gui/Core/Toplevel.cs
  2. 4 1
      Terminal.Gui/Core/Window.cs

+ 1 - 1
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) {

+ 4 - 1
Terminal.Gui/Core/Window.cs

@@ -201,7 +201,10 @@ namespace Terminal.Gui {
 				if (dragPosition.HasValue) {
 					if (SuperView == null) {
 						Application.Top.SetNeedsDisplay (Frame);
-						Application.Top.Redraw (Bounds);
+						// 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);
 					}