8000 feat: Add a toggle in the settings for video hardware acceleration by AngelCMHxD · Pull Request #1117 · Vencord/Vesktop · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: Add a toggle in the settings for video hardware acceleration #1117

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ process.env.VENCORD_USER_DATA_DIR = DATA_DIR;
function init() {
app.setAsDefaultProtocolClient("discord");

const { disableSmoothScroll, hardwareAcceleration } = Settings.store;
const { disableSmoothScroll, hardwareAcceleration, videoHardwareAcceleration } = Settings.store;

const enabledFeatures = app.commandLine.getSwitchValue("enable-features").split(",");
const disabledFeatures = app.commandLine.getSwitchValue("disable-features").split(",");

if (hardwareAcceleration === false) {
app.disableHardwareAcceleration();
} else {
}

if (hardwareAcceleration && videoHardwareAcceleration) {
enabledFeatures.push(
"AcceleratedVideoDecodeLinuxGL",
"AcceleratedVideoEncoder",
Expand Down
1 change: 1 addition & 0 deletions src/renderer/patches/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ import "./windowsTitleBar";
import "./streamerMode";
import "./nativeFocus";
import "./hideDownloadAppsButton";
import "./videoHardwareAcceleration";
23 changes: 23 additions & 0 deletions src/renderer/patches/videoHardwareAcceleration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2025 Vendicated and Vesktop contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/

import { Settings } from "renderer/settings";

import { addPatch } from "./shared";

if (Settings.store.videoHardwareAcceleration === undefined) Settings.store.videoHardwareAcceleration = true;

addPatch({
patches: [
{
find: "setHardwareEncoding(e){",
replacement: {
match: /setHardwareEncoding\(e\){/,
replace: "$&Vesktop.Settings.store.videoHardwareAcceleration=e;"
}
}
]
});
1 change: 1 addition & 0 deletions src/shared/settings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +1 5349 6,7 @@ export interface Settings {
enableMenu?: boolean;
disableSmoothScroll?: boolean;
hardwareAcceleration?: boolean;
videoHardwareAcceleration?: boolean;
arRPC?: boolean;
appBadge?: boolean;
disableMinSize?: boolean;
Expand Down
0