Skip to content

[Bug] "Failed to get WebGL context" error spam while painting on devices without hardware acceleration #384

Description

@kekneus373

Description:
On devices where hardware acceleration is disabled (e.g., webgl: Disabled in chrome://gpu), JS Paint repeatedly triggers a "Failed to get WebGL context. You may need to refresh the web page, or restart your computer." error message.

This is not just a nuisance; it lowkey prevents usage. The error dialog appears for every single pixel drawn, making it impossible to paint. The basic drawing tools like lines and spray paint function correctly despite the error, although the pencil, brush, ellipse, polygon and rounded rectangle do not appear to be responsive.

Steps to Reproduce:

  1. Disable hardware acceleration in the browser (or use a device where WebGL is forced off, like a very old PC).
  2. Open JS Paint.
  3. Attempt to draw with the mentioned "broken" tools.
  4. Observe the error dialog appearing repeatedly with every stroke/pixel.

Proposed Solutions:
I unerstand that WebGL use is hardcoded and does not affect users of post-2010 devices, so I I suggest one of the following approaches to make it easy and fair for everybody:

  1. Remove the Error Popup: Simply remove the code that triggers the error dialog.
  2. Session-Only Warning: If the error must be logged, display the popup only once per session, rather than on every interaction / tool change.
  3. Silent Fallback: Log the warning to the console (console.warn) but do not interrupt the user workflow with a modal dialog.

Allegedly, these 3 solutions should be relatively easy to implement.

Also I believe it's worth noting this statement in the project's README:

▼ Electron app limitations:

  • Minor details:
    • WebGL error messages tell you to refresh without offering a way to reload; also, calling the app a web page feels unpolished

Ig it's a good time to address the issue? 🙂

Expected Behavior:
The application should detect the lack of WebGL support, switch to a fallback mode silently (or with a single startup notification), and allow the user to paint without interruption.

Environment:

  • Browser: Brave 151.
  • WebGL Status: Disabled, Unavailable.
  • OS: NixOS 26.05 running XFCE under X11.
  • GPU: ATI Radeon X1300 Pro (no H/W acceleration possible)
  • This is a retro build

If you find the issue relevant, consider leaving a like or commenting 👍

Some pictures of the error + PC specs Image Image Image

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