Fix deadlock when calling Pages.SendToFront

Resolves #21.
This commit is contained in:
Trevor Slocum 2020-06-09 15:05:03 -07:00
parent 0fa19fee28
commit a0a7d39949
2 changed files with 5 additions and 4 deletions

View File

@ -4,6 +4,7 @@ v1.4.7 (WIP)
- Fix default background transparency of Flex and Grid
- Fix negative List offset and DropDown selection
- Fix panic when clicking nil primitive in Flex
- Fix deadlock when calling Pages.SendToFront
- Fix ANSI colors 0-15
- Fix ANSI SGR codes

View File

@ -253,17 +253,17 @@ func (p *Pages) SendToFront(name string) *Pages {
p.pages = append(append(p.pages[:index], p.pages[index+1:]...), page)
}
if page.Visible && p.changed != nil {
p.Lock()
p.changed()
p.Unlock()
p.changed()
p.Lock()
}
break
}
}
if hasFocus {
p.Lock()
p.Focus(p.setFocus)
p.Unlock()
p.Focus(p.setFocus)
p.Lock()
}
return p
}