Focus new tab after remove

After removing a tab we should focus the newly selected tab if it is
Interactive. This ensures things like the terminal get drawn properly.
This commit is contained in:
Jeffas 2019-09-16 17:39:03 +01:00 committed by Drew DeVault
parent 956f1366a5
commit 0ce1d42bda

View file

@ -77,6 +77,10 @@ func (tabs *Tabs) Remove(content Drawable) {
index, ok := tabs.popHistory() index, ok := tabs.popHistory()
if ok { if ok {
tabs.Select(index) tabs.Select(index)
interactive, ok := tabs.Tabs[tabs.Selected].Content.(Interactive)
if ok {
interactive.Focus(true)
}
} }
tabs.TabStrip.Invalidate() tabs.TabStrip.Invalidate()
} }