From c0f7dc5ef651513cb8a5184f84d3f9a562e142f0 Mon Sep 17 00:00:00 2001 From: BDisp Date: Wed, 11 Mar 2020 03:17:02 +0000 Subject: [PATCH] Failure behavior solved. It was a threading safe issue. Driver.Wakeup () moved to the Post method on MainLoopSyncContext class solved it. --- Terminal.Gui/Core.cs | 1 + Terminal.Gui/MonoCurses/mainloop.cs | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Terminal.Gui/Core.cs b/Terminal.Gui/Core.cs index 778c55635..e5d713281 100644 --- a/Terminal.Gui/Core.cs +++ b/Terminal.Gui/Core.cs @@ -1726,6 +1726,7 @@ namespace Terminal.Gui { { mainLoop.AddIdle (() => { d (state); + mainLoop.Driver.Wakeup (); return false; }); } diff --git a/Terminal.Gui/MonoCurses/mainloop.cs b/Terminal.Gui/MonoCurses/mainloop.cs index 280c4dfee..f2927f8e0 100644 --- a/Terminal.Gui/MonoCurses/mainloop.cs +++ b/Terminal.Gui/MonoCurses/mainloop.cs @@ -354,10 +354,9 @@ namespace Mono.Terminal { /// public Func AddIdle (Func idleHandler) { - lock (idleHandlers) { + lock (idleHandlers) idleHandlers.Add (idleHandler); - driver.Wakeup (); - } + return idleHandler; }