Skip to content

style.cursor does not work for OffscreenCanvas #16492

@connorjclark

Description

@connorjclark

Version of emscripten/emsdk:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.7 (48a16209b1a0de5efd8112ce6430415730008d18)
clang version 15.0.0 (https://github.com/llvm/llvm-project fbce4a78035c32792b0a13cf1f169048b822c06b)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: C:\Users\cjamc\tools\emsdk\upstream\bin

I hope a picture is sufficient:

image
image

here's my flags:

USE_FLAGS=(
  -s USE_FREETYPE=1
  -s USE_VORBIS=1
  -s USE_OGG=1
  -s USE_LIBJPEG=1
  -s USE_SDL=2
  -s USE_LIBPNG=1
  -s FULL_ES2=1
  -s LLD_REPORT_UNDEFINED
  -s TOTAL_MEMORY=4294836224
  -s USE_PTHREADS=1
  -s PTHREAD_POOL_SIZE=12
  -s PROXY_TO_PTHREAD=1
  -s OFFSCREENCANVAS_SUPPORT=1
  -O2
  -g
)

Related issues/PRs:

#3568
#3623
#3623

This has been fixed previously for setting the cursor via the proxy to worker feature. I'm using two features not mentioned in the above PRs: PROXY_TO_PTHREAD and OFFSCREENCANVAS_SUPPORT. I suspect one or both of these aren't setup to proxy setting the styles from a worker thread to the main thread.

( aside; I am aware that SDL does not yet support proxy_to_pthread emscripten-ports/SDL2#127 . I suppose when it does I can forgo OFFSCREENCANVAS_SUPPORT? I hope so, because even after commenting out this cursor code I get an error about the main thread trying to get the context of a canvas that has been transfered to a worker Failed to execute 'getContext' on 'HTMLCanvasElement': Cannot get context from a canvas that has transferred its control to offscreen ... the only reason I'm using OFFSCREENCANVAS_SUPPORT in the first place is because I was getting webgl errors in a worker )

EDIT: I just noticed https://github.com/libsdl-org/SDL/pull/5365/files#diff-41bdc236909c8708ff058aa571192a0db6e42e4373f12011b7dd3171bc2e586aR234 addresses this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions