From d9658efc6515eb1262c59cdc5c2a52734a0d9eef Mon Sep 17 00:00:00 2001 From: Tig Date: Wed, 3 Apr 2024 11:13:23 -0600 Subject: [PATCH] Cherry picked new Mouse Scenario --- Terminal.Gui/ConsoleDrivers/WindowsDriver.cs | 3 +++ UICatalog/Scenarios/Mouse.cs | 1 + 2 files changed, 4 insertions(+) diff --git a/Terminal.Gui/ConsoleDrivers/WindowsDriver.cs b/Terminal.Gui/ConsoleDrivers/WindowsDriver.cs index 60989c586..b6ccaf9a2 100644 --- a/Terminal.Gui/ConsoleDrivers/WindowsDriver.cs +++ b/Terminal.Gui/ConsoleDrivers/WindowsDriver.cs @@ -2128,6 +2128,9 @@ internal class WindowsMainLoop : IMainLoopDriver void IMainLoopDriver.TearDown () { + // Eat any outstanding events + //var r = _winConsole.ReadConsoleInput (); + _inputHandlerTokenSource?.Cancel (); _inputHandlerTokenSource?.Dispose (); diff --git a/UICatalog/Scenarios/Mouse.cs b/UICatalog/Scenarios/Mouse.cs index 966c90423..7c8bcaf35 100644 --- a/UICatalog/Scenarios/Mouse.cs +++ b/UICatalog/Scenarios/Mouse.cs @@ -9,6 +9,7 @@ public class Mouse : Scenario { public override void Main () { + Application.Init (); Window win = new () { Title = $"{Application.QuitKey} to Quit - Scenario: {GetName ()}",