Skip to content

[Bug]: Electron propagates GDK_BACKEND=x11 to subprocesses, breaking shell.openExternal with Firefox on Wayland #28436

@andersk

Description

@andersk

Preflight Checklist

Electron Version

12.0.9
13.0.1
14.1.0
15.1.1

What operating system are you using?

Other Linux

Operating System Version

NixOS 21.05

What arch are you using?

x64

Last Known Working Electron version

12.0.0-beta.20

Expected Behavior

shell.openExternal("https://electronjs.org/") opens a browser tab at https://electronjs.org/. (My browser is Firefox on Wayland with MOZ_ENABLE_WAYLAND=1, and has other tabs already open.)

Actual Behavior

Firefox shows this error and does not open a tab:

“Firefox is already running, but is not responding. To use Firefox, you must first close the existing Firefox process, restart your device, or use a different profile.”

Testcase Gist URL

https://gist.github.com/31ec2165f4aa806536e11d7d99d1e26f

I bisected this to v12.0.0-beta.20...v12.0.0-beta.21 (9faf235...5dbb635).

The difference between v12.0.0-beta.20’s working invocation of xdg-open and v12.0.0-beta.21’s failing invocation is that the latter has GDK_BACKEND=x11 in the environment. I confirmed that this is responsible for the failure with manual invocations of

xdg-open https://electronjs.org/  # works
env GDK_BACKEND=x11 xdg-open https://electronjs.org/  # fails

I don’t know if Electron or Chromium need to set GDK_BACKEND=x11 for their own purposes, but it definitely should not be propagated to subprocesses such as xdg-open.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy