USE_WAYLAND env value handler

This commit is contained in:
smartfridge 2022-12-27 16:12:34 +01:00
parent e6cc8689f0
commit 6355082718

View file

@ -25,15 +25,18 @@ if (!app.requestSingleInstanceLock()) {
} else {
// Your data now belongs to CCP
crashReporter.start({uploadToServer: false});
if (process.platform == "linux") {
if (process.env.XDG_SESSION_TYPE == "wayland") {
console.log("Wayland specific patches applied.");
app.commandLine.appendSwitch("ozone-platform=wayland");
if (process.env.XDG_CURRENT_DESKTOP == "GNOME") {
app.commandLine.appendSwitch("enable-features=UseOzonePlatform,WaylandWindowDecorations");
} else {
app.commandLine.appendSwitch("enable-features=UseOzonePlatform");
if (process.env.USE_WAYLAND == "0") {
console.log("Wayland patches disabled.");
} else {
if (process.platform == "linux") {
if (process.env.XDG_SESSION_TYPE == "wayland") {
console.log("Wayland specific patches applied.");
app.commandLine.appendSwitch("ozone-platform=wayland");
if (process.env.XDG_CURRENT_DESKTOP == "GNOME") {
app.commandLine.appendSwitch("enable-features=UseOzonePlatform,WaylandWindowDecorations");
} else {
app.commandLine.appendSwitch("enable-features=UseOzonePlatform");
}
}
}
}