Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: return early from platform_util::Beep() on Linux if there is no default GDK display#49442

Merged
jkleinsc merged 1 commit intoelectron:mainfrom
nmggithub:bell_sigsev_patch
Jan 21, 2026
Merged

fix: return early from platform_util::Beep() on Linux if there is no default GDK display#49442
jkleinsc merged 1 commit intoelectron:mainfrom
nmggithub:bell_sigsev_patch

Conversation

@nmggithub
Copy link
Contributor

Description of Change

Adds a missing null check for when gdk_display_get_default() returns NULL.

Should fix #49436.

Checklist

Release Notes

Notes: Fixed crash in platform_util::Beep() on Linux

@welcome
Copy link

welcome bot commented Jan 19, 2026

💖 Thanks for opening this pull request! 💖

Semantic PR titles

We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix.

Examples of commit messages with semantic prefixes:

  • fix: don't overwrite prevent_default if default wasn't prevented
  • feat: add app.isPackaged() method
  • docs: app.isDefaultProtocolClient is now available on Linux

Commit signing

This repo enforces commit signatures for all incoming PRs.
To sign your commits, see GitHub's documentation on Telling Git about your signing key.

PR tips

Things that will help get your PR across the finish line:

  • Follow the JavaScript, C++, and Python coding style.
  • Run npm run lint locally to catch formatting errors earlier.
  • Document any user-facing changes you've made following the documentation styleguide.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Jan 19, 2026
@nmggithub
Copy link
Contributor Author

nmggithub commented Jan 19, 2026

Honestly, not sure why we moved to GTK/GDK-specific code here (#44734)

@ckerr thoughts?

The older method did seem more generic, albeit clunky. Is using the GTK/GDK API's here safe for all cases where shell.beep() could be used (including Main and unsandboxed Render threads, as referenced here as supposed contexts for shell)?

@nmggithub nmggithub changed the title fix: return early from beep on linux if there is no default gdk display fix: return early from platform_util::Beep() on Linux if there is no default GDK display Jan 19, 2026
@codebytere codebytere added semver/patch backwards-compatible bug fixes target/39-x-y PR should also be added to the "39-x-y" branch. target/40-x-y PR should also be added to the "40-x-y" branch. target/41-x-y PR should also be added to the "41-x-y" branch. labels Jan 21, 2026
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Jan 21, 2026
@codebytere
Copy link
Member

@nmggithub please sign your commit!

@nmggithub
Copy link
Contributor Author

@nmggithub please sign your commit!

Will do! Just give me a few moments!

@nmggithub
Copy link
Contributor Author

@nmggithub please sign your commit!

Should be signed now! Apologies for not doing that before.

@jkleinsc jkleinsc merged commit 534cb33 into electron:main Jan 21, 2026
104 of 105 checks passed
@release-clerk
Copy link

release-clerk bot commented Jan 21, 2026

Release Notes Persisted

Fixed crash in platform_util::Beep() on Linux

@trop
Copy link
Contributor

trop bot commented Jan 21, 2026

I have automatically backported this PR to "40-x-y", please check out #49482

@trop trop bot added in-flight/40-x-y and removed target/40-x-y PR should also be added to the "40-x-y" branch. labels Jan 21, 2026
@trop
Copy link
Contributor

trop bot commented Jan 21, 2026

I have automatically backported this PR to "41-x-y", please check out #49483

@trop
Copy link
Contributor

trop bot commented Jan 21, 2026

I have automatically backported this PR to "39-x-y", please check out #49484

@trop trop bot added in-flight/41-x-y in-flight/39-x-y and removed target/41-x-y PR should also be added to the "41-x-y" branch. target/39-x-y PR should also be added to the "39-x-y" branch. labels Jan 21, 2026
@trop trop bot added merged/40-x-y PR was merged to the "40-x-y" branch. merged/41-x-y PR was merged to the "41-x-y" branch. merged/39-x-y PR was merged to the "39-x-y" branch. and removed in-flight/40-x-y in-flight/41-x-y in-flight/39-x-y labels Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/39-x-y PR was merged to the "39-x-y" branch. merged/40-x-y PR was merged to the "40-x-y" branch. merged/41-x-y PR was merged to the "41-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

shell.beep() causing segmentation fault

3 participants

Comments