diff --git a/Terminal.Gui/Drivers/WindowsDriver.cs b/Terminal.Gui/Drivers/WindowsDriver.cs
index 0576071e3..ea71233ac 100644
--- a/Terminal.Gui/Drivers/WindowsDriver.cs
+++ b/Terminal.Gui/Drivers/WindowsDriver.cs
@@ -522,9 +522,9 @@ namespace Terminal.Gui {
void WindowsInputHandler ()
{
while (true) {
- waitForProbe.Wait ();
+ waitForProbe.Wait ();
waitForProbe.Reset ();
-
+
uint numberEventsRead = 0;
WindowsConsole.ReadConsoleInput (winConsole.InputHandle, records, 1, out numberEventsRead);
@@ -568,8 +568,19 @@ namespace Terminal.Gui {
waitForProbe.Set ();
try {
- if (!tokenSource.IsCancellationRequested)
- eventReady.Wait (waitTimeout, tokenSource.Token);
+ while (result == null) {
+ if (wait && waitTimeout == -1) {
+ waitTimeout = 0;
+ }
+ if (!tokenSource.IsCancellationRequested)
+ eventReady.Wait (waitTimeout, tokenSource.Token);
+ if (result != null) {
+ break;
+ }
+ if (mainLoop.timeouts.Count > 0 || mainLoop.idleHandlers.Count > 0) {
+ return true;
+ }
+ }
} catch (OperationCanceledException) {
return true;
} finally {
diff --git a/Terminal.Gui/MonoCurses/mainloop.cs b/Terminal.Gui/MonoCurses/mainloop.cs
index 5a9c49360..eda74d73f 100644
--- a/Terminal.Gui/MonoCurses/mainloop.cs
+++ b/Terminal.Gui/MonoCurses/mainloop.cs
@@ -214,7 +214,18 @@ namespace Mono.Terminal {
UpdatePollMap ();
- n = poll (pollmap, (uint)pollmap.Length, pollTimeout);
+ while (true) {
+ if (wait && pollTimeout == -1) {
+ pollTimeout = 0;
+ }
+ n = poll (pollmap, (uint)pollmap.Length, pollTimeout);
+ if (pollmap != null) {
+ break;
+ }
+ if (mainLoop.timeouts.Count > 0 || mainLoop.idleHandlers.Count > 0) {
+ return true;
+ }
+ }
int ic;
lock (mainLoop.idleHandlers)
ic = mainLoop.idleHandlers.Count;
@@ -454,7 +465,7 @@ namespace Mono.Terminal {
running = false;
driver.Wakeup ();
}
-
+
///
/// Determines whether there are pending events to be processed.
///
diff --git a/Terminal.Gui/Views/ScrollView.cs b/Terminal.Gui/Views/ScrollView.cs
index 502bb0a9f..fddf7c7ce 100644
--- a/Terminal.Gui/Views/ScrollView.cs
+++ b/Terminal.Gui/Views/ScrollView.cs
@@ -521,13 +521,19 @@ namespace Terminal.Gui {
///
public override bool MouseEvent (MouseEvent me)
{
- if (me.Flags != MouseFlags.WheeledDown && me.Flags != MouseFlags.WheeledUp)
+ if (me.Flags != MouseFlags.WheeledDown && me.Flags != MouseFlags.WheeledUp &&
+ me.Flags != MouseFlags.Button1Pressed && me.Flags != MouseFlags.Button1Clicked &&
+ !me.Flags.HasFlag (MouseFlags.Button1Pressed | MouseFlags.ReportMousePosition))
return false;
if (me.Flags == MouseFlags.WheeledDown)
ScrollDown (1);
else if (me.Flags == MouseFlags.WheeledUp)
ScrollUp (1);
+ else if (me.X == vertical.Frame.X)
+ vertical.MouseEvent (me);
+ else if (me.Y == horizontal.Frame.Y)
+ horizontal.MouseEvent (me);
return true;
}
diff --git a/UICatalog/Scenario.cs b/UICatalog/Scenario.cs
index b43821a4e..9b6442b95 100644
--- a/UICatalog/Scenario.cs
+++ b/UICatalog/Scenario.cs
@@ -6,7 +6,7 @@ using Terminal.Gui;
namespace UICatalog {
///
- /// Base class for each demo/scenario. To define a new sceanrio simply
+ /// Base class for each demo/scenario. To define a new scenario simply
///
/// 1) declare a class derived from Scenario,
/// 2) Set Name and Description as appropriate using [ScenarioMetadata] attribute
@@ -14,8 +14,8 @@ namespace UICatalog {
/// 4) Implement Setup.
/// 5) Optionally, implement Run.
///
- /// The Main program uses reflection to find all sceanarios and adds them to the
- /// ListViews. Press ENTER to run the selected sceanrio. Press CTRL-Q to exit it.
+ /// The Main program uses reflection to find all scenarios and adds them to the
+ /// ListViews. Press ENTER to run the selected scenario. Press CTRL-Q to exit it.
///
public class Scenario : IDisposable {
private bool _disposedValue;
@@ -26,6 +26,7 @@ namespace UICatalog {
public Toplevel Top { get; set; }
///
+ /// The Window for the Scenario. This should be set within the `Application.Top` in most cases.
///
public Window Win { get; set; }
@@ -88,7 +89,7 @@ namespace UICatalog {
public string GetName () => ScenarioMetadata.GetName (this.GetType ());
///
- /// Helper to get the Scenario Descripiton
+ /// Helper to get the Scenario Description
///
///
public string GetDescription () => ScenarioMetadata.GetDescription (this.GetType ());
@@ -137,7 +138,7 @@ namespace UICatalog {
}
///
- /// Runs the scenario. Override to start the scearnio using a Top level different than `Top`.
+ /// Runs the scenario. Override to start the scenario using a Top level different than `Top`.
///
public virtual void Run ()
{