mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
build: another attempt to fix snap #5252
This commit is contained in:
parent
22e3b68497
commit
2209767e77
2 changed files with 19 additions and 4 deletions
|
|
@ -227,12 +227,19 @@ export class IdleTimeHandler {
|
|||
// Try gdbus first as it might work better in snap environments
|
||||
let command =
|
||||
'gdbus call --session --dest org.gnome.Mutter.IdleMonitor --object-path /org/gnome/Mutter/IdleMonitor/Core --method org.gnome.Mutter.IdleMonitor.GetIdletime';
|
||||
const isSnap = !!process.env.SNAP;
|
||||
|
||||
// Check if gdbus is available
|
||||
try {
|
||||
await execAsync('which gdbus', { timeout: 1000 });
|
||||
} catch {
|
||||
// Fall back to dbus-send if gdbus is not available
|
||||
if (isSnap) {
|
||||
log.warn(
|
||||
'gdbus unavailable in snap environment, skipping dbus-send fallback to avoid libdbus mismatch',
|
||||
);
|
||||
return null;
|
||||
}
|
||||
// Fall back to dbus-send if gdbus is not available outside of snap
|
||||
command =
|
||||
'dbus-send --print-reply --dest=org.gnome.Mutter.IdleMonitor /org/gnome/Mutter/IdleMonitor/Core org.gnome.Mutter.IdleMonitor.GetIdletime';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,6 +112,15 @@ export const startApp = (): void => {
|
|||
return true;
|
||||
};
|
||||
|
||||
const enableSwiftshaderFallback = (): void => {
|
||||
log('Snap: Forcing Chromium SwiftShader software renderer fallback');
|
||||
app.commandLine.appendSwitch('use-angle', 'swiftshader');
|
||||
app.commandLine.appendSwitch('use-gl', 'swiftshader');
|
||||
app.commandLine.appendSwitch('enable-webgl');
|
||||
app.commandLine.appendSwitch('ignore-gpu-blacklist');
|
||||
app.commandLine.appendSwitch('ignore-gpu-blocklist');
|
||||
};
|
||||
|
||||
// Workaround for Electron 38+ snap package GPU issues (issue #5252)
|
||||
// Electron 38.1+ has GPU/Mesa driver access issues in snap confinement
|
||||
const isForceGpu = process.argv.some((val) => val.includes('--enable-gpu'));
|
||||
|
|
@ -147,9 +156,8 @@ export const startApp = (): void => {
|
|||
// Chromium's sandbox conflicts with snap confinement causing launch failures
|
||||
app.commandLine.appendSwitch('no-sandbox');
|
||||
} else if (isSnap && !isForceGpu) {
|
||||
log(
|
||||
'Snap: Falling back to hardware acceleration because llvmpipe renderer is unavailable',
|
||||
);
|
||||
log('Snap: llvmpipe renderer unavailable, falling back to SwiftShader');
|
||||
enableSwiftshaderFallback();
|
||||
}
|
||||
|
||||
// Initialize protocol handling
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue