mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(electron): force GTK 3 on Linux to avoid GTK 2/3 vs GTK 4 crash
Enforce GTK 3 via app.commandLine switch on Linux to prevent mixed GTK symbol errors seen on Fedora AppImage.
This commit is contained in:
@@ -16,6 +16,17 @@ const dirname = path.dirname(__filename);
|
|||||||
// Load package.json dynamically
|
// Load package.json dynamically
|
||||||
const packageJson = JSON.parse(fs.readFileSync(path.join(dirname, '../package.json'), 'utf-8'));
|
const packageJson = JSON.parse(fs.readFileSync(path.join(dirname, '../package.json'), 'utf-8'));
|
||||||
|
|
||||||
|
// Enforce GTK 3 on Linux to avoid mixing GTK 4 and GTK 3 in the same process
|
||||||
|
// which can happen on some distros/desktops and crashes AppImage with:
|
||||||
|
// "GTK 2/3 symbols detected. Using GTK 2/3 and GTK 4 in the same process is not supported"
|
||||||
|
if (process.platform === 'linux') {
|
||||||
|
try {
|
||||||
|
app.commandLine.appendSwitch('gtk-version', '3');
|
||||||
|
} catch (e) {
|
||||||
|
// ignore – if unsupported, Electron will simply ignore this switch
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let startIpfsError;
|
let startIpfsError;
|
||||||
startIpfs.onError = (error) => {
|
startIpfs.onError = (error) => {
|
||||||
// only show error once or it spams the user
|
// only show error once or it spams the user
|
||||||
|
|||||||
Reference in New Issue
Block a user