Browse Source

No need to throw if after all a valid console is preserved.

BDisp 2 năm trước cách đây
mục cha
commit
509a8d15c7
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      Terminal.Gui/ConsoleDrivers/WindowsDriver.cs

+ 2 - 1
Terminal.Gui/ConsoleDrivers/WindowsDriver.cs

@@ -252,7 +252,8 @@ namespace Terminal.Gui {
 			}
 			var winRect = new SmallRect (0, 0, (short)(newCols - 1), (short)Math.Max (newRows - 1, 0));
 			if (!SetConsoleWindowInfo (OutputHandle, true, ref winRect)) {
-				throw new System.ComponentModel.Win32Exception (Marshal.GetLastWin32Error ());
+				//throw new System.ComponentModel.Win32Exception (Marshal.GetLastWin32Error ());
+				return new Size (cols, rows);
 			}
 			SetConsoleOutputWindow (csbi);
 			return new Size (winRect.Right + 1, newRows - 1 < 0 ? 0 : winRect.Bottom + 1);