Skip to content

[Bug]: Setting vibrancy on macOS breaks click events on WebContentsView in Electron 31 #42336

Description

@Hans-Halverson

Preflight Checklist

Electron Version

31.0.0-beta.7

What operating system are you using?

macOS

Operating System Version

macOS Sonoma 14.4.1

What arch are you using?

arm64 (including Apple Silicon)

Last Known Working Electron version

29 (with BrowserViews), vibrancy is currently broken with a separate bug in 30

Expected Behavior

Click events on a WebContentsView should be detected when the BrowserWindow has vibrancy set on macOS. Depending on the version of Electron used for the attached gist, click events are either swallowed or cause the app to crash.

Actual Behavior

Click events on the WebContentsView are not registered (or potentially cause the app to crash). If I remove the vibrancy setting from the BrowserWindow then click events start working again.

In the attached gist you can see this by trying to click the red square, which should display an alert due to an onclick handler (and does display the alert when vibrancy is disabled).

Testcase Gist URL

https://gist.github.com/7f123c2282516503a73c7c0a43eb26d2

Additional Information

Like #42335, this issue also appears to trace back to this PR: #41326. The bug in the attached gist is first seen in v31.0.0-nightly.20240305, and is not seen in v31.0.0-nightly.20240304 (and the only PR in between is #41326).

However this is a bit more complicated because vibrancy still has this bug in v31.0.0-nightly.20240304 so the attached gist isn't functional, just for a different reason. I can confirm that if this potential fix for the vibrancy bug in Electron 30 is applied without #41326 then the click swallows/crashes in this issue are resolved.

When using a debug build I see that click events crash the app on this DCHECK with this stack trace

Activity

  1. added
    has-repro-gist
    on May 31, 2024
  2. moved this to 👀 Unsorted Items in 31-x-yon May 31, 2024
  3. added
    status/confirmed
    on Jun 3, 2024
  4. self-assigned this
    on Jun 20, 2024
  5. moved this from 👀 Unsorted Items to 👍 Does Not Block Stable in 31-x-yon Jun 20, 2024
  6. moved this to 👀 Unsorted Items in 32-x-yon Jun 20, 2024
  7. moved this from 👀 Unsorted Items to 🛑 Blocks Stable in 32-x-yon Jun 20, 2024
  8. moved this from 🛑 Blocks Stable to 🛠️ Fixed for Next Release in 32-x-yon Jul 31, 2024
  9. added a commit that references this issue on Oct 29, 2024
    1aa1b96
  10. added 2 commits that reference this issue on Nov 11, 2024
    a81b1ec
    0272c2b
  11. added 3 commits that reference this issue on Jan 15, 2025
    c0d5d24
    3c44230
    b39762f
  12. added a commit that references this issue on Jan 17, 2025
    6953f55
  13. added a commit that references this issue on Jan 17, 2025
    41b3832
  14. added a commit that references this issue on Jan 23, 2025
    91bb748
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

31-x-ybug 🪲component/WebContentsViewhas-repro-gistplatform/macOSstatus/confirmed

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions