Skip to content

Conversation

@codebytere
Copy link
Member

Description of Change

This PR adds app.isHardwareAccelerationEnabled(), which can be used to determine whether hardware acceleration has been disabled either on the machine or via app.disableHardwareAcceleration().

Checklist

Release Notes

Notes: Added app.isHardwareAccelerationEnabled()

@codebytere codebytere requested a review from a team June 30, 2025 11:00
@codebytere codebytere added semver/minor backwards-compatible functionality api-review/requested 🗳 target/36-x-y PR should also be added to the "36-x-y" branch. target/37-x-y PR should also be added to the "37-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch. labels Jun 30, 2025
@codebytere codebytere force-pushed the is-hardware-acceleration-enabled branch from bf13304 to ee82128 Compare June 30, 2025 11:00
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Jun 30, 2025
Copy link
Member

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this API should only return true if hardware acceleration is currently turned off and the dependency on the flag disable_hw_acceleration_ means that it might not be true

@codebytere codebytere force-pushed the is-hardware-acceleration-enabled branch from ee82128 to 3ba2bd4 Compare July 4, 2025 13:25
@codebytere codebytere requested a review from samuelmaddock July 4, 2025 13:29
Copy link
Member

@erickzhao erickzhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

@itsananderson
Copy link
Member

It sounds like there are more than two possible states for hardware acceleration:

  • Uninitialized
  • Uninitialized (but explicitly disabled)
  • Initialized and enabled
  • Initialized and disabled

If we just implement a single function that returns a boolean, we're dropping potentially useful information about the state of hardware acceleration.

My suggestion would be to provide two functions which can be combined to get a richer snapshot of the state of hw acceleration.

function isHardwareAccelerationRequested(): bool

function getHardwareAccelerationState(): "uninitialized" | "enabled" | "disabled"

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Jul 7, 2025
Copy link
Member

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

@github-actions github-actions bot added the target/39-x-y PR should also be added to the "39-x-y" branch. label Sep 3, 2025
@jkleinsc jkleinsc force-pushed the is-hardware-acceleration-enabled branch from 3ba2bd4 to b117b5c Compare October 23, 2025 16:40
@ckerr ckerr merged commit b389377 into main Oct 27, 2025
106 of 107 checks passed
@ckerr ckerr deleted the is-hardware-acceleration-enabled branch October 27, 2025 19:03
@release-clerk
Copy link

release-clerk bot commented Oct 27, 2025

Release Notes Persisted

Added app.isHardwareAccelerationEnabled()

@trop
Copy link
Contributor

trop bot commented Oct 27, 2025

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

@trop
Copy link
Contributor

trop bot commented Oct 27, 2025

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

@trop trop bot removed the target/37-x-y PR should also be added to the "37-x-y" branch. label Oct 27, 2025
@trop
Copy link
Contributor

trop bot commented Oct 27, 2025

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

@trop
Copy link
Contributor

trop bot commented Oct 27, 2025

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

@trop trop bot added in-flight/39-x-y in-flight/38-x-y in-flight/36-x-y and removed target/39-x-y PR should also be added to the "39-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch. target/36-x-y PR should also be added to the "36-x-y" branch. in-flight/36-x-y labels Oct 27, 2025
TheCommieAxolotl pushed a commit to TheCommieAxolotl/electron that referenced this pull request Nov 2, 2025
* feat: add app.isHardwareAccelerationEnabled()

* chore: address review feedback
@trop trop bot added merged/37-x-y PR was merged to the "37-x-y" branch. merged/39-x-y PR was merged to the "39-x-y" branch. merged/38-x-y PR was merged to the "38-x-y" branch. and removed in-flight/37-x-y in-flight/39-x-y in-flight/38-x-y labels Nov 13, 2025
nilayarya pushed a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
* feat: add app.isHardwareAccelerationEnabled()

* chore: address review feedback
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
* feat: add app.isHardwareAccelerationEnabled()

* chore: address review feedback
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
* feat: add app.isHardwareAccelerationEnabled()

* chore: address review feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-review/approved ✅ merged/37-x-y PR was merged to the "37-x-y" branch. merged/38-x-y PR was merged to the "38-x-y" branch. merged/39-x-y PR was merged to the "39-x-y" branch. semver/minor backwards-compatible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants