浏览代码

Fixes #2860. Application views do not refresh when the cursor is moved with CursesDriver.

BDisp 1 年之前
父节点
当前提交
c90366a03d
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      Terminal.Gui/ConsoleDrivers/CursesDriver/UnixMainLoop.cs

+ 4 - 0
Terminal.Gui/ConsoleDrivers/CursesDriver/UnixMainLoop.cs

@@ -175,6 +175,10 @@ namespace Terminal.Gui {
 			if (mainLoop.timeouts.Count > 0) {
 			if (mainLoop.timeouts.Count > 0) {
 				pollTimeout = (int)((mainLoop.timeouts.Keys [0] - now) / TimeSpan.TicksPerMillisecond);
 				pollTimeout = (int)((mainLoop.timeouts.Keys [0] - now) / TimeSpan.TicksPerMillisecond);
 				if (pollTimeout < 0) {
 				if (pollTimeout < 0) {
+					// This avoids poll waiting infinitely if pollTimeout=-1 until some action is detected
+					if (pollTimeout == -1) {
+						pollTimeout = 0;
+					}
 					return true;
 					return true;
 				}
 				}
 			} else
 			} else