Skip to content

Commit 88f3d05

Browse files
committed
Fixed more cases
1 parent fd5a2b6 commit 88f3d05

File tree

7 files changed

+13
-7
lines changed

7 files changed

+13
-7
lines changed

CommunityToolkitExample/LoginView.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public void Receive (Message<LoginActions> message)
5959
}
6060
}
6161
SetText();
62+
// BUGBUG: This should not be needed:
6263
Application.LayoutAndDraw ();
6364
}
6465

Terminal.Gui/Application/Application.Keyboard.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ internal static void AddApplicationKeyBindings ()
205205
Command.Refresh,
206206
static () =>
207207
{
208-
LayoutAndDraw ();
208+
LayoutAndDraw (true);
209209

210210
return true;
211211
}

Terminal.Gui/Application/Application.Run.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,6 @@ public static void LayoutAndDraw (bool forceDraw = false)
508508
if (ClearScreenNextIteration)
509509
{
510510
forceDraw = true;
511-
ClearScreenNextIteration = false;
512511
}
513512
if (forceDraw)
514513
{

Terminal.Gui/Application/Application.Screen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static bool OnSizeChanging (SizeChangedEventArgs args)
6363
t.SetNeedsLayout ();
6464
}
6565

66-
LayoutAndDraw ();
66+
LayoutAndDraw (true);
6767

6868
return true;
6969
}

Terminal.Gui/View/View.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,14 @@ public virtual bool Visible
369369
SetNeedsLayout ();
370370
SuperView?.SetNeedsLayout ();
371371
SetNeedsDraw ();
372-
SuperView?.SetNeedsDraw ();
372+
if (SuperView is { })
373+
{
374+
SuperView?.SetNeedsDraw ();
375+
}
376+
else
377+
{
378+
Application.ClearScreenNextIteration = true;
379+
}
373380
}
374381
}
375382

Terminal.Gui/Views/Menu/Menu.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,7 @@ public void Run (Action? action)
608608

609609
Application.UngrabMouse ();
610610
_host.CloseAllMenus ();
611-
Application.Driver!.ClearContents ();
612-
Application.LayoutAndDraw ();
611+
Application.LayoutAndDraw (true);
613612

614613
_host.Run (action);
615614
}

Terminal.Gui/Views/Menu/MenuBar.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ internal bool SelectItem (MenuItem? item)
11171117

11181118
Application.UngrabMouse ();
11191119
CloseAllMenus ();
1120-
Application.LayoutAndDraw ();
1120+
Application.LayoutAndDraw (true);
11211121
_openedByAltKey = true;
11221122

11231123
return Run (item.Action);

0 commit comments

Comments
 (0)