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

Allow users to pass --enable/disable-features flag #527

Merged
merged 3 commits into from
Apr 26, 2024

Conversation

takase1121
Copy link
Contributor

This PR implements the solution in #526.

I am also looking to adding the flags to Vesktop, unfortunately it is impossible to set the argument in time as app.getGPUInfo() is async and I don't know if Electron has already initialized the GUI backend by then. It might be worth looking into as a toggle in the settings (probably something like "Experimental Video Decode Acceleration on AMD" but this is so specific it's hard to come out with a suitable name).

@Vendicated
Copy link
Member

Vendicated commented Apr 20, 2024

this is meh. if the user wants to override one switch, it will disable everything else

why not merge our switches into the user switches? could do the same for disable-features

const features = app.commandLine.getSwitchValue("enable-features").split(",");
features.push("Feature1", "Feature2");

app.commandLine.appendSwitch("enable-features", [...new Set(features)].filter(Boolean).join(","));

@takase1121
Copy link
Contributor Author

this is meh. if the user wants to override one switch, it will disable everything else

why not merge our switches into the user switches? could do the same for disable-features

const features = app.commandLine.getSwitchValue("enable-features").split(",");
features.push("Feature1", "Feature2");

app.commandLine.appendSwitch("enable-features", [...new Set(features)].filter(Boolean).join(","));

That would be an option. I'm just mainly concerned with conflicting switches.m, but I think it will probably be fine.

@takase1121
Copy link
Contributor Author

I'm just mainly concerned with conflicting switches.m, but I think it will probably be fine.

This might not be an issue at all. When a flag appears in both enable-features and disable-features, it will be disabled. If someone wants to override Vesktop's flags, they can just disable them from the CLI. Assuming Vesktop doesn't disable something crazy by default (right not it doesn't) this will work well.

P.S.: Is this something worth documenting?

@takase1121 takase1121 changed the title Do not override enable-features flags Append to --enable-features flags correctly Apr 21, 2024
@Vendicated Vendicated changed the title Append to --enable-features flags correctly Allow users to pass --enable/disable-features flag Apr 26, 2024
@Vendicated Vendicated merged commit 0beb74f into Vencord:main Apr 26, 2024
1 check passed
@Vendicated
Copy link
Member

thank you!

TheAyes pushed a commit to TheAyes/Vesktop that referenced this pull request May 2, 2024
Previously they would be overwritten by vesktop
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.

2 participants