diff options
author | Gokcehan <gokcehankara@gmail.com> | 2021-10-19 22:51:25 +0300 |
---|---|---|
committer | Gokcehan <gokcehankara@gmail.com> | 2021-10-19 22:51:25 +0300 |
commit | 7872455021c800df9d9cf45f44b7cda03f0f927c (patch) | |
tree | 1e9fbe2d9ee62a4011247536792fa9f4c16a9ec0 | |
parent | 1b71c33afd1a6158b9d6d1da606149c171a08d9f (diff) |
restart event polling after ui resume on windowsr26
cc #677
-rw-r--r-- | ui.go | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -465,6 +465,7 @@ func (win *win) printDir(screen tcell.Screen, dir *dir, selections map[string]in type ui struct { screen tcell.Screen + polling bool wins []*win promptWin *win msgWin *win @@ -538,6 +539,7 @@ func newUI(screen tcell.Screen) *ui { ui := &ui{ screen: screen, + polling: true, wins: getWins(screen), promptWin: newWin(wtot, 1, 0, 0), msgWin: newWin(wtot, 1, 0, htot-1), @@ -561,6 +563,7 @@ func (ui *ui) pollEvents() { for { ev = ui.screen.PollEvent() if ev == nil { + ui.polling = false return } ui.tevChan <- ev @@ -1169,7 +1172,12 @@ func (ui *ui) suspend() error { } func (ui *ui) resume() error { - return ui.screen.Resume() + err := ui.screen.Resume() + if !ui.polling { + go ui.pollEvents() + ui.polling = true + } + return err } func anyKey() { |