Browse Source

Disable HACK_CHECK_WINCHANGED.

BDisp 9 months ago
parent
commit
173f8205be

+ 1 - 0
Terminal.Gui/Application/Application.Run.cs

@@ -493,6 +493,7 @@ public static partial class Application // Run (Begin, Run, End, Stop)
         {
             if (tl.LayoutNeeded)
             {
+                tl.SetRelativeLayout (new (Driver!.Cols, Driver.Rows));
                 tl.LayoutSubviews ();
             }
 

+ 12 - 10
Terminal.Gui/ConsoleDrivers/WindowsDriver.cs

@@ -13,7 +13,7 @@
 // the WindowsConsole.EventType.WindowBufferSize event. However, on Init the window size is
 // still incorrect so we still need this hack.
 
-#define HACK_CHECK_WINCHANGED
+//#define HACK_CHECK_WINCHANGED
 
 using System.Collections.Concurrent;
 using System.ComponentModel;
@@ -1708,15 +1708,17 @@ internal class WindowsDriver : ConsoleDriver
                 break;
 
 #if !HACK_CHECK_WINCHANGED
-		case WindowsConsole.EventType.WindowBufferSize:
-			
-			Cols = inputEvent.WindowBufferSizeEvent._size.X;
-			Rows = inputEvent.WindowBufferSizeEvent._size.Y;
-
-			ResizeScreen ();
-			ClearContents ();
-			TerminalResized.Invoke ();
-			break;
+            case WindowsConsole.EventType.WindowBufferSize:
+
+                Cols = inputEvent.WindowBufferSizeEvent._size.X;
+                Rows = inputEvent.WindowBufferSizeEvent._size.Y;
+
+                ResizeScreen ();
+                ClearContents ();
+                Application.Top?.SetNeedsLayout ();
+                Application.Refresh ();
+
+                break;
 #endif
         }
     }