mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-02 01:03:29 +01:00
Fixed quit scenario bug. WorkerApp, when hidden, was eating QuitKey
This commit is contained in:
@@ -702,7 +702,7 @@ public class ListView : View
|
||||
/// <returns><see langword="true"/> if the <see cref="OpenSelectedItem"/> event was fired.</returns>
|
||||
public bool OnOpenSelectedItem ()
|
||||
{
|
||||
if (_source.Count <= _selected || _selected < 0 || OpenSelectedItem is null)
|
||||
if (_source is null || _source.Count <= _selected || _selected < 0 || OpenSelectedItem is null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ public class BackgroundWorkerCollection : Scenario
|
||||
|
||||
KeyDown += (s, e) =>
|
||||
{
|
||||
if (e.KeyCode == KeyCode.Esc)
|
||||
if (e == Application.QuitKey)
|
||||
{
|
||||
OnReportClosed (this, EventArgs.Empty);
|
||||
}
|
||||
@@ -357,6 +357,9 @@ public class BackgroundWorkerCollection : Scenario
|
||||
};
|
||||
Add (_listLog);
|
||||
|
||||
// We don't want WorkerApp to respond to the quitkey
|
||||
KeyBindings.Remove (Application.QuitKey);
|
||||
|
||||
Closing += WorkerApp_Closing;
|
||||
Closed += WorkerApp_Closed;
|
||||
}
|
||||
@@ -439,15 +442,7 @@ public class BackgroundWorkerCollection : Scenario
|
||||
{
|
||||
// Failed
|
||||
WriteLog (
|
||||
$"Exception occurred {
|
||||
e.Error.Message
|
||||
} on Worker {
|
||||
staging.StartStaging
|
||||
}.{
|
||||
staging.StartStaging
|
||||
:fff} at {
|
||||
DateTime.Now
|
||||
}"
|
||||
$"Exception occurred {e.Error.Message} on Worker {staging.StartStaging}.{staging.StartStaging:fff} at {DateTime.Now}"
|
||||
);
|
||||
}
|
||||
else if (e.Cancelled)
|
||||
|
||||
Reference in New Issue
Block a user