Skip to content

Deprecate & remove ELECTRON_OZONE_PLATFORM_HINT env var #48001

Closed

Description

@clavin

Timeline

  • Deprecation: Electron 38
  • Removal: Electron 39

Background

While working on the main upgrade roll for Electron 39, this change that removes the --ozone-platform-hint flag was causing an error. After tracking it back to a change, I discovered the flag was being removed because the default value became auto. That change landed in Chromium 140 which is part of Electron 38.

Curious about our env var's intended behavior, I searched through the history of it. I learned it was added to make it simple for users to tell Electron apps to automatically detect Wayland.1 Since the auto behavior is now the default, ELECTRON_OZONE_PLATFORM_HINT's purpose is equivalent to XDG_SESSION_TYPE and we can remove it without losing any convenience for those Wayland users.

I also noticed the flag removal in Chromium is also being backported to Chromium 140. We should keep the environment variable "working" for Electron 38 to give users time to adapt if something unexpected comes up. If we decide that the risk is not large enough, we can also choose to do the removal in Electron 38, but I'm planning to do the removal in Electron 39.

The removal will be backwards-compatible, so users running apps with Electron 38 and below will continue to accept the ELECTRON_OZONE_PLATFORM_HINT and Electron 39 and above will safely ignore it.

Footnotes

  1. It can also be set to wayland to force Wayland instead of potentially falling back to X11; however, auto works by inspecting the XDG_SESSION_TYPE env var, meaning ours now acts like an alias for that one. ↩

Activity

  1. self-assigned this
    on Aug 8, 2025
  2. added theissue type on Aug 8, 2025
  3. clavin commented on Aug 8, 2025

    @clavin
    MemberAuthor

    @VerteDinde @ckerr Wise Linux experts, I'm curious what you think about this plan?

  4. nikwen commented on Aug 8, 2025

    @nikwen
    Member

    Potentially related: #46843 (as in: this issue can probably be closed once this lands)

  5. clavin commented on Aug 11, 2025

    @clavin
    MemberAuthor

    Closing as finished in #47983

  6. leithouse commented on Sep 3, 2025

    @leithouse

    @clavin How do I now tell Electron that it has to use Wayland?

    Your assumption seems to be that the only use case was ELECTRON_OZONE_PLATFORM_HINT=auto but my production software is now broken because I can't do ELECTRON_OZONE_PLATFORM_HINT=wayland.

    Setting XDG_SESSION_TYPE=wayland has no effect and I still get an X11-related error and a seg-fault:

    [23615:0903/112048.191370:ERROR:ui/ozone/platform/x11/ozone_platform_x11.cc:249] Missing X server or $DISPLAY
    [23615:0903/112048.191409:ERROR:ui/aura/env.cc:257] The platform failed to initialize.  Exiting.
    Segmentation fault (core dumped)
    
  7. nikwen commented on Sep 11, 2025

    @nikwen
    Member

    @leithouse Thanks for your comment!

    Let's continue the discussion on this new issue: #48298

  8. added a commit that references this issue on Jan 26, 2026
  9. added a commit that references this issue on Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions