فهرست منبع

Allowing multi-thread toplevels.

BDisp 5 سال پیش
والد
کامیت
4fc50aae90
1فایلهای تغییر یافته به همراه11 افزوده شده و 4 حذف شده
  1. 11 4
      Terminal.Gui/Core/Application.cs

+ 11 - 4
Terminal.Gui/Core/Application.cs

@@ -586,16 +586,23 @@ namespace Terminal.Gui {
 
 
 					MainLoop.MainIteration ();
 					MainLoop.MainIteration ();
 					Iteration?.Invoke ();
 					Iteration?.Invoke ();
-				} else if (wait == false)
+				} else if (wait == false) {
 					return;
 					return;
-				if (state.Toplevel.NeedDisplay != null && (!state.Toplevel.NeedDisplay.IsEmpty || state.Toplevel.childNeedsDisplay)) {
+				}
+				if (state.Toplevel != Top && (!Top.NeedDisplay.IsEmpty || Top.childNeedsDisplay)) {
+					Top.Redraw (Top.Bounds);
+					state.Toplevel.SetNeedsDisplay (state.Toplevel.Bounds);
+				}
+				if (!state.Toplevel.NeedDisplay.IsEmpty || state.Toplevel.childNeedsDisplay) {
 					state.Toplevel.Redraw (state.Toplevel.Bounds);
 					state.Toplevel.Redraw (state.Toplevel.Bounds);
-					if (DebugDrawBounds)
+					if (DebugDrawBounds) {
 						DrawBounds (state.Toplevel);
 						DrawBounds (state.Toplevel);
+					}
 					state.Toplevel.PositionCursor ();
 					state.Toplevel.PositionCursor ();
 					Driver.Refresh ();
 					Driver.Refresh ();
-				} else
+				} else {
 					Driver.UpdateCursor ();
 					Driver.UpdateCursor ();
+				}
 			}
 			}
 		}
 		}