Skip to content

Rendering to a Window hangs in linux #264

@goldenratio

Description

@goldenratio

Hey,

when I try to run below code snippet, in Fedora 42 (i3wm, uses x11 display server) - terminal becomes unresponsive. I have to Ctrl + C to kill the process.

Searching the issues list, #159 sounds similar. I have no warning or error messages.

import { Window } from 'skia-canvas'

let win = new Window(300, 300, { fit: 'none' })
win.title = "Canvas Window"
win.on("draw", e => {
  let ctx = e.target.canvas.getContext("2d")
  ctx.lineWidth = 25 + 25 * Math.cos(e.frame / 10)
  ctx.beginPath()
  ctx.arc(150, 150, 50, 0, 2 * Math.PI)
  ctx.stroke()

  ctx.beginPath()
  ctx.arc(150, 150, 10, 0, 2 * Math.PI)
  ctx.stroke()
  ctx.fill()
})
 node ./main.js
skia-canvas-demo tree -L 2
.
├── main.js
├── node_modules
│   ├── agent-base
│   ├── debug
│   ├── detect-libc
│   ├── follow-redirects
│   ├── https-proxy-agent
│   ├── ms
│   ├── parenthesis
│   ├── skia-canvas
│   └── string-split-by
├── package.json
├── package-lock.json
└── rainbox.png

11 directories, 4 files

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions