Skip to content

Deprecate & remove ELECTRON_OZONE_PLATFORM_HINT env var #48001

@clavin

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.

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