From 0d93d73c3210b3e94b7f25e708ffd09c2679f771 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Mon, 3 Jun 2024 20:43:05 -0400 Subject: [PATCH] Backend returns CanvasCloser --- x/backend.go | 2 +- x/canvas/canvas.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/x/backend.go b/x/backend.go index 3fc3cc5..a73f79d 100644 --- a/x/backend.go +++ b/x/backend.go @@ -126,7 +126,7 @@ func (this *Backend) NewTexture (source image.Image) canvas.TextureCloser { return xcanvas.NewTextureFrom(source) } -func (this *Backend) NewCanvas (bounds image.Rectangle) canvas.Canvas { +func (this *Backend) NewCanvas (bounds image.Rectangle) canvas.CanvasCloser { return xcanvas.NewCanvas(this.x, bounds) } diff --git a/x/canvas/canvas.go b/x/canvas/canvas.go index 748bfe5..8b6a72a 100644 --- a/x/canvas/canvas.go +++ b/x/canvas/canvas.go @@ -49,9 +49,10 @@ func (this *Canvas) Push (window xproto.Window) { } // Close frees this canvas from the X server. -func (this *Canvas) Close () { +func (this *Canvas) Close () error { this.assert() this.Image.Destroy() + return nil } func (this *Canvas) assert () {