diff --git a/backends/x/x.go b/backends/x/x.go index 517c8b3..a514a65 100644 --- a/backends/x/x.go +++ b/backends/x/x.go @@ -74,6 +74,11 @@ func (backend *Backend) calculateWindowSize () (x, y int) { return } +func (backend *Backend) bindCanvas () { + backend.canvas.XSurfaceSet(backend.window.Id) + backend.canvas.XDraw() + backend.canvas.XPaint(backend.window.Id) +} // factory instantiates an X backend. func factory (application *stone.Application) (output stone.Backend, err error) { @@ -106,6 +111,15 @@ func factory (application *stone.Application) (output stone.Backend, err error) 0) backend.window.Map() + // create a canvas + backend.canvas = xgraphics.New ( + backend.connection, + image.Rect ( + 0, 0, + windowWidth, + windowHeight)) + backend.bindCanvas() + // attatch graceful close handler backend.window.WMGracefulClose (func (window *xwindow.Window) { backend.window.Destroy()