mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-27 00:07:58 +01:00
Fixed a focused issue.
This commit is contained in:
@@ -748,6 +748,9 @@ namespace Terminal.Gui {
|
||||
view.SetNeedsDisplay ();
|
||||
}
|
||||
OnRemoved (view);
|
||||
if (focused == view) {
|
||||
focused = null;
|
||||
}
|
||||
}
|
||||
|
||||
void PerformActionForSubview (View subview, Action<View> action)
|
||||
@@ -1882,9 +1885,6 @@ namespace Terminal.Gui {
|
||||
Remove (subview);
|
||||
subview.Dispose ();
|
||||
}
|
||||
if (Application.Top.focused == this) {
|
||||
Application.Top.focused = null;
|
||||
}
|
||||
base.Dispose (disposing);
|
||||
}
|
||||
|
||||
|
||||
@@ -1019,11 +1019,13 @@ namespace Terminal.Gui {
|
||||
LastFocused = lastFocused;
|
||||
lastFocused = null;
|
||||
if (LastFocused != null) {
|
||||
CanFocus = false;
|
||||
if (!reopen) {
|
||||
selected = -1;
|
||||
}
|
||||
LastFocused.SuperView?.SetFocus (LastFocused);
|
||||
} else {
|
||||
CanFocus = true;
|
||||
SuperView.SetFocus (this);
|
||||
PositionCursor ();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user