Explorar el Código

Fixes #4204. v2win and v2net aren't refreshing the Character Map correctly (#4205)

* Fixes #4204. v2win and v2net aren't refreshing the Character Map correctly

* Reformat to run CI again

* Revert "Reformat to run CI again"

This reverts commit 3efad83f5288216135d36983dff4bbcfbfdcfdd6.

* Revert "Fixes #4204. v2win and v2net aren't refreshing the Character Map correctly"

This reverts commit 6ec4adcc4555893343f723028cd9bb43d95d380f.

* Apply @tig suggested changes

* Fixes #4208. MainLoopSyncContext doesn't work with the v2 drivers

* Trying fix unit test error

* Revert "Trying fix unit test error"

This reverts commit 3aaefd6053f7c6e237f4faca536494e49424712b.

---------

Co-authored-by: Tig <[email protected]>
BDisp hace 1 mes
padre
commit
807f1fdcc8
Se han modificado 1 ficheros con 6 adiciones y 5 borrados
  1. 6 5
      Terminal.Gui/ViewBase/View.cs

+ 6 - 5
Terminal.Gui/ViewBase/View.cs

@@ -245,12 +245,13 @@ public partial class View : IDisposable, ISupportInitializeNotification
             }
         }
 
-        if (ApplicationImpl.Instance.IsLegacy)
-        {
-            // TODO: Figure out how to move this out of here and just depend on LayoutNeeded in Mainloop
-            Layout (); // the EventLog in AllViewsTester fails to layout correctly if this is not here (convoluted Dim.Fill(Func)).
-        }
+        // Force a layout each time a View is initialized
+        // See: https://github.com/gui-cs/Terminal.Gui/issues/3951
+        // See: https://github.com/gui-cs/Terminal.Gui/issues/4204
+        Layout (); // the EventLog in AllViewsTester fails to layout correctly if this is not here (convoluted Dim.Fill(Func)).
 
+        // Complex layout scenarios (e.g. DimAuto and PosAlign) may require multiple layouts to be performed.
+        // Thus, we call SetNeedsLayout() to ensure that the layout is performed at least once.
         SetNeedsLayout ();
 
         Initialized?.Invoke (this, EventArgs.Empty);