mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-11-01 16:33:07 -06:00
Schedule a redraw when resuming from suspension
Until now the repaint after fg was accidental: it only happened because the suspend keybinding handler still had a flush pending on the UI thread, and only if that flush happened to run after the SIGCONT handler had re-engaged the screen. Now that flushes are skipped while suspended, losing that race would leave the screen blank until the next input event arrives, so schedule a redraw explicitly (#5309).
This commit is contained in:
1 parent
d887a41ad2
commit
319f43e166
2 files changed
+5
-3
No files matched your search
@@ -1976,6 +1976,11 @@ func (g *Gui) Resume() error {
|
||||
|
||||
g.suspended = false
|
||||
|
||||
// Schedule a redraw of the whole screen. Nothing else guarantees one:
|
||||
// flushes are skipped while suspended, and after re-engaging the screen
|
||||
// the terminal shows nothing until we draw again.
|
||||
go func() { g.gEvents <- GocuiEvent{Type: eventResize} }()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -64,9 +64,6 @@ func TestResumeSchedulesRedraw(t *testing.T) {
|
||||
case <-time.After(100 * time.Millisecond):
|
||||
}
|
||||
|
||||
/* EXPECTED:
|
||||
assert.Equal(t, eventResize, ev.Type,
|
||||
"resuming must schedule a redraw; without one the screen stays blank until the next event arrives")
|
||||
ACTUAL: */
|
||||
assert.Equal(t, eventNone, ev.Type)
|
||||
}
|
||||
Reference in new issue
Block a user