Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows not appearing #159

Open
kevinJ045 opened this issue Jul 6, 2024 · 1 comment
Open

Windows not appearing #159

kevinJ045 opened this issue Jul 6, 2024 · 1 comment

Comments

@kevinJ045
Copy link

No windows appear. i tried most examples. but nothing appears. i tried this code:

const { Window, Canvas } = require('skia-canvas')

let canvas = new Canvas(32, 32),
    colors = ['orange', 'yellow', 'green', 'skyblue', 'purple']

for (var c of colors){
  ctx = canvas.newPage(canvas.width * 2, canvas.height * 2)
  ctx.fillStyle = c
  ctx.fillRect(0,0, canvas.width, canvas.height)
  ctx.fillStyle = 'white'
  ctx.arc(canvas.width/2, canvas.height/2, 40, 0, 2 * Math.PI)
  ctx.fill()
}

let win = new Window({canvas, page:-2})
win.on('keydown', e => {
  if (e.key=='Left') win.page--
  if (e.key=='Right') win.page++
  console.log(`page ${win.page}/${canvas.pages.length}: ${canvas.width} × ${canvas.height}`)
})

It just logs this:

warning: queue 0x2b392ad0 destroyed while proxies still attached:
  wl_keyboard@16 still attached
  wl_output@13 still attached
  xdg_activation_v1@12 still attached
  zwp_pointer_constraints_v1@11 still attached
  zwp_text_input_manager_v3@10 still attached
  zxdg_decoration_manager_v1@9 still attached
  zwp_relative_pointer_manager_v1@8 still attached
  wl_shm@7 still attached
  wl_subcompositor@6 still attached
  wl_compositor@5 still attached
  wl_seat@4 still attached
  wl_registry@2 still attached

and quits, i am on nixos with wayland.

@samizdatco
Copy link
Owner

Version 2.0 made extensive changes to the Vulkan renderer used on Linux (including adding debugging info to canvas.engine when gpu initialization fails). Do you get a different message when running this code on Skia Canvas 2.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants