瀏覽代碼

Merge pull request #2266 from AaronLieberman/unix-idle-fix

Fixes #2265 - Keyboard input doesn't work in UnixMainLoop when Idle function is registered
Tig 2 年之前
父節點
當前提交
d5abc2001f
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      Terminal.Gui/ConsoleDrivers/CursesDriver/UnixMainLoop.cs

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

@@ -181,16 +181,15 @@ namespace Terminal.Gui {
 		{
 			UpdatePollMap ();
 
-			if (CheckTimers (wait, out var pollTimeout)) {
-				return true;
-			}
+			bool checkTimersResult = CheckTimers (wait, out var pollTimeout);
 
 			var n = poll (pollmap, (uint)pollmap.Length, pollTimeout);
 
 			if (n == KEY_RESIZE) {
 				winChanged = true;
 			}
-			return n >= KEY_RESIZE || CheckTimers (wait, out pollTimeout);
+
+			return checkTimersResult || n >= KEY_RESIZE;
 		}
 
 		bool CheckTimers (bool wait, out int pollTimeout)