X backend only sends what it needs to

This commit is contained in:
Sasha Koshka 2022-11-11 23:46:46 -05:00
parent e4f97a918a
commit 47ee6545cb

View File

@ -100,13 +100,16 @@ func (backend *Backend) Draw () {
if boundsChanged {
backend.reallocateCanvas()
}
backend.drawCells(true)
backend.canvas.XDraw()
backend.canvas.XPaint(backend.window.Id)
} else {
// backend.drawCells(false)
// backend.canvas.XDraw()
// backend.canvas.XPaint(backend.window.Id)
// FIXME use this instead once it works
// backend.updateWindowAreas(...)
backend.updateWindowAreas(backend.drawCells(false)...)
}
}
func (backend *Backend) SetTitle (title string) (err error) {
@ -252,6 +255,7 @@ func (backend *Backend) drawCells (forceRedraw bool) (areas []image.Rectangle) {
content := cell.Rune()
if content < 32 { continue }
areas = append(areas, backend.boundsOfCell(x, y))
backend.drawRune(x, y, content)
}}
return