Skip to content

Commit

Permalink
Workaround for changing CanFocus throwing Exceptions sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
tznind committed Feb 25, 2023
1 parent ed17727 commit 7929084
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Terminal.Gui/Views/TileView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,11 @@ public override bool ProcessHotKey (KeyEvent keyEvent)
if(keyEvent.Key == ToggleResizable) {
foreach(var l in splitterLines) {

var iniBefore = l.IsInitialized;
l.IsInitialized = false;
l.CanFocus = !l.CanFocus;

l.IsInitialized = iniBefore;

if (l.CanFocus && !focusMoved) {
l.SetFocus ();
focusMoved = true;
Expand Down

0 comments on commit 7929084

Please sign in to comment.