瀏覽代碼

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

BDisp 2 年之前
父節點
當前提交
509a8d15c7
共有 1 個文件被更改,包括 2 次插入1 次删除
  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);