mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Fix bug with UnixMainLoop and idle
When running in WSL Ubuntu, I was unable to process input. The issue was that when there's an idle function registered with the main loop, UnixMainLoop doesn't ever call poll. Without the poll call, pollmap doesn't get updated and the input callback doesn't get called. Change this so that it calls poll every loop iteration, even if there's an idle function.
This commit is contained in:
@@ -176,16 +176,15 @@ namespace Terminal.Gui {
|
|||||||
{
|
{
|
||||||
UpdatePollMap ();
|
UpdatePollMap ();
|
||||||
|
|
||||||
if (CheckTimers (wait, out var pollTimeout)) {
|
bool checkTimersResult = CheckTimers (wait, out var pollTimeout);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var n = poll (pollmap, (uint)pollmap.Length, pollTimeout);
|
var n = poll (pollmap, (uint)pollmap.Length, pollTimeout);
|
||||||
|
|
||||||
if (n == KEY_RESIZE) {
|
if (n == KEY_RESIZE) {
|
||||||
winChanged = true;
|
winChanged = true;
|
||||||
}
|
}
|
||||||
return n >= KEY_RESIZE || CheckTimers (wait, out pollTimeout);
|
|
||||||
|
return checkTimersResult || n >= KEY_RESIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CheckTimers (bool wait, out int pollTimeout)
|
bool CheckTimers (bool wait, out int pollTimeout)
|
||||||
|
|||||||
Reference in New Issue
Block a user