Skip to content

Commit

Permalink
Remove "prfmMode" setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Milkshiift committed Mar 20, 2024
1 parent c384fb7 commit c26f9ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 35 deletions.
11 changes: 0 additions & 11 deletions assets/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,6 @@
"description": "Disable microphone auto-gain. It can be useful when your mic is quieter than it should be.",
"inputType": "checkbox"
},
"prfmMode": {
"name": "Performance mode",
"defaultValue": "none",
"description": "Performance mode is an experimental feature that may either increase responsiveness and performance of GoofCord or… decrease it. Try every option and see which fits you the best.",
"inputType": "dropdown",
"options": [
"none",
"performance",
"battery"
]
},
"discordUrl": {
"name": "Discord URL",
"defaultValue": "https://discord.com/app",
Expand Down
30 changes: 6 additions & 24 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ if (isDev()) {
} catch (e) {}
}

setFlags();

if (!app.requestSingleInstanceLock()) app.exit();

crashReporter.start({uploadToServer: false});

loadConfig().then(async () => {
setFlags();
if (getConfig("autoscroll")) app.commandLine.appendSwitch("enable-blink-features", "MiddleClickAutoscroll");
setAutoLaunchState();
setMenu();

Expand Down Expand Up @@ -59,29 +61,9 @@ async function setFlags() {
"HardwareMediaKeyHandling," + // Prevent Discord from registering as a media service.
"MediaSessionService," + // ⤴
"WidgetLayering," + // Fix dev tools layers
"WebRtcAllowInputVolumeAdjustment"
"WebRtcAllowInputVolumeAdjustment," +
"Vulkan"
);
app.commandLine.appendSwitch("enable-features", "WebRTC,VaapiVideoDecoder,VaapiVideoEncoder,WebRtcHideLocalIpsWithMdns,PlatformHEVCEncoderSupport");
app.commandLine.appendSwitch("enable-features", "WebRTC,VaapiVideoDecoder,VaapiVideoEncoder,WebRtcHideLocalIpsWithMdns,PlatformHEVCEncoderSupport,EnableDrDc,CanvasOopRasterization,UseSkiaRenderer");
app.commandLine.appendSwitch("autoplay-policy", "no-user-gesture-required");

if (getConfig("autoscroll")) {
app.commandLine.appendSwitch("enable-blink-features", "MiddleClickAutoscroll");
}

const presets = {
performance: "--enable-gpu-rasterization --enable-zero-copy --ignore-gpu-blocklist --enable-hardware-overlays=single-fullscreen,single-on-top,underlay --enable-features=EnableDrDc,CanvasOopRasterization,BackForwardCache:TimeToLiveInBackForwardCacheInSeconds/300/should_ignore_blocklists/true/enable_same_site/true,ThrottleDisplayNoneAndVisibilityHiddenCrossOriginIframes,UseSkiaRenderer,WebAssemblyLazyCompilation --disable-features=Vulkan --force_high_performance_gpu", // Performance
battery: "--enable-features=TurnOffStreamingMediaCachingOnBattery --force_low_power_gpu" // Known to have better battery life for Chromium?
};
switch (getConfig("prfmMode")) {
case "performance":
console.log("Performance mode enabled");
app.commandLine.appendSwitch(presets.performance);
break;
case "battery":
console.log("Battery mode enabled");
app.commandLine.appendSwitch(presets.battery);
break;
default:
console.log("No performance modes set");
}
}

0 comments on commit c26f9ee

Please sign in to comment.