Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support GPU acceleration settings on Windows & Linux #2266

Merged

Conversation

lyimmi
Copy link
Contributor

@lyimmi lyimmi commented Jan 1, 2023

This PR adds support for webview GPU settings on Windows and Linux as discussed in issue #2264.

Windows:

  • Created a new option WebviewGpuIsDisabled in windows.Options
  • Modified the new webview loader to be able to accept chromium switches.
  • When WebviewGpuIsDisabled set to true the webview will be initialized with the --disable-gpu switch.

Linux:

  • Created a new option WebviewGpuPolicy in linux.Options.
  • Created a new type WebviewGpuPolicy and three constants to be used as options.
    • WebviewGpuPolicyAlways
    • WebviewGpuPolicyOnDemand
    • WebviewGpuPolicyNever
  • When the webview is set up the hardware acceleration policy is set based on the option. The default setting is WebviewGpuPolicyAlways, if it is not a valid option for the system GTK ignores it and sets an appropriate value.

Mac:
This setting is not available.

Copy link
Collaborator

@stffabi stffabi left a comment

Choose a reason for hiding this comment

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

LGTM. Awesome, thanks for doing this. 👍

Just two minor comments and maybe you could also already add the changelog entry.

@lyimmi
Copy link
Contributor Author

lyimmi commented Jan 1, 2023

I found a bug. If you don't set the linux options, the setup crashes. I'm fixing it now!

@lyimmi lyimmi force-pushed the feature/2264_support_webview_gpu_option branch from 1d8271b to 78b9e63 Compare January 1, 2023 20:26
@lyimmi
Copy link
Contributor Author

lyimmi commented Jan 1, 2023

LGTM. Awesome, thanks for doing this. +1

Just two minor comments and maybe you could also already add the changelog entry.

Thanks @stffabi, I added the change log as well!

@stffabi
Copy link
Collaborator

stffabi commented Jan 1, 2023

You're welcome, thanks for doing this 🙏

@lyimmi lyimmi changed the title Support GPU acceleration settings on Window & Linux Support GPU acceleration settings on Windows & Linux Jan 1, 2023
Copy link
Member

@leaanthony leaanthony left a comment

Choose a reason for hiding this comment

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

This is great @lyimmi !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants