diff --git a/backends/x/event.go b/backends/x/event.go index e55c61e..1291f23 100644 --- a/backends/x/event.go +++ b/backends/x/event.go @@ -33,6 +33,10 @@ func (backend *Backend) handleConfigureNotify ( configureEvent = backend.compressConfigureNotify(configureEvent) + // we should not resize the canvas while drawing is taking place + backend.drawLock.Lock() + defer backend.drawLock.Unlock() + // resize buffer width, height := backend.calculateBufferSize() backend.application.SetSize(width, height) diff --git a/examples/color/main.go b/examples/color/main.go index 07776e7..e18be99 100644 --- a/examples/color/main.go +++ b/examples/color/main.go @@ -44,7 +44,7 @@ func main () { } func redraw () { - text :="RAINBOW :D" + text := "RAINBOW :D" width, height := application.Size() application.Dot.X = (width - len(text)) / 2