Skip to content

Commit

Permalink
Merge branch 'v2_develop' of tig:gui-cs/Terminal.Gui into v2_develop
Browse files Browse the repository at this point in the history
  • Loading branch information
tig committed Oct 17, 2023
2 parents b0dc1e6 + 15d0c04 commit 56a31f1
Show file tree
Hide file tree
Showing 12 changed files with 2,489 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Terminal.Gui/ConsoleDrivers/CursesDriver/CursesDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ public override void PrepareToRun (MainLoop mainLoop, Action<KeyEvent> keyHandle
return true;
});

_mainLoop.WinChanged += ProcessInput;
_mainLoop.WinChanged = ProcessInput;
}

public override void Init (Action terminalResized)
Expand Down
2 changes: 1 addition & 1 deletion Terminal.Gui/ConsoleDrivers/FakeDriver/FakeDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public override void PrepareToRun (MainLoop mainLoop, Action<KeyEvent> keyHandle
_keyUpHandler = keyUpHandler;

// Note: Net doesn't support keydown/up events and thus any passed keyDown/UpHandlers will never be called
(mainLoop.MainLoopDriver as FakeMainLoop).KeyPressed += (consoleKey) => ProcessInput (consoleKey);
(mainLoop.MainLoopDriver as FakeMainLoop).KeyPressed = (consoleKey) => ProcessInput (consoleKey);
}

void ProcessInput (ConsoleKeyInfo consoleKey)
Expand Down
16 changes: 13 additions & 3 deletions Terminal.Gui/ConsoleDrivers/NetDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public NetEvents (ConsoleDriver consoleDriver)

public InputResult? DequeueInput ()
{
while (!_inputReadyCancellationTokenSource.Token.IsCancellationRequested) {
while (_inputReadyCancellationTokenSource != null && !_inputReadyCancellationTokenSource.Token.IsCancellationRequested) {
_waitForStart.Set ();
_winChange.Set ();

Expand Down Expand Up @@ -185,7 +185,12 @@ void ProcessInputQueue ()
{
while (!_inputReadyCancellationTokenSource.Token.IsCancellationRequested) {

_waitForStart.Wait (_inputReadyCancellationTokenSource.Token);
try {
_waitForStart.Wait (_inputReadyCancellationTokenSource.Token);
} catch (OperationCanceledException) {

return;
}
_waitForStart.Reset ();

if (_inputQueue.Count == 0) {
Expand Down Expand Up @@ -1339,9 +1344,14 @@ void NetInputHandler ()
} catch (OperationCanceledException) {
return;
} finally {
_waitForProbe.Reset ();
if (_waitForProbe.IsSet) {
_waitForProbe.Reset ();
}
}

if (_inputHandlerTokenSource.IsCancellationRequested) {
return;
}
if (_resultQueue.Count == 0) {
_resultQueue.Enqueue (_netEvents.DequeueInput ());
}
Expand Down
4 changes: 2 additions & 2 deletions Terminal.Gui/ConsoleDrivers/WindowsDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -861,9 +861,9 @@ public override void PrepareToRun (MainLoop mainLoop, Action<KeyEvent> keyHandle
_mouseHandler = mouseHandler;

_mainLoop = mainLoop.MainLoopDriver as WindowsMainLoop;
_mainLoop.ProcessInput += ProcessInput;
_mainLoop.ProcessInput = ProcessInput;
#if HACK_CHECK_WINCHANGED
_mainLoop.WinChanged += ChangeWin;
_mainLoop.WinChanged = ChangeWin;
#endif
}

Expand Down
5 changes: 5 additions & 0 deletions Terminal.Gui/Drawing/Glyphs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ public class GlyphDefinitions {
/// </summary>
public Rune Dot { get; set; } = (Rune)'∙';

/// <summary>
/// Black Circle . Default is (U+025cf) - ●.
/// </summary>
public Rune BlackCircle { get; set; } = (Rune)'●'; // Black Circle - ● U+025cf

/// <summary>
/// Expand (e.g. for <see cref="TreeView"/>.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Terminal.Gui/Types/Point.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public struct Point
/// <remarks>
/// An uninitialized Point Structure.
/// </remarks>

public static readonly Point Empty;

/// <summary>
Expand Down
Loading

0 comments on commit 56a31f1

Please sign in to comment.