mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
build: next attempt #5252
This commit is contained in:
parent
f00f2a18c9
commit
55f40afe5e
2 changed files with 22 additions and 3 deletions
|
|
@ -225,9 +225,9 @@ export class IdleTimeHandler {
|
|||
private async getGnomeIdleTime(): Promise<number | null> {
|
||||
try {
|
||||
// Try gdbus first as it might work better in snap environments
|
||||
const isSnap = !!process.env.SNAP;
|
||||
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 {
|
||||
|
|
@ -244,7 +244,17 @@ export class IdleTimeHandler {
|
|||
'dbus-send --print-reply --dest=org.gnome.Mutter.IdleMonitor /org/gnome/Mutter/IdleMonitor/Core org.gnome.Mutter.IdleMonitor.GetIdletime';
|
||||
}
|
||||
|
||||
const { stdout } = await execAsync(command, { timeout: 5000 });
|
||||
let stdout: string;
|
||||
try {
|
||||
const result = await execAsync(command, { timeout: 5000 });
|
||||
stdout = result.stdout;
|
||||
} catch (error) {
|
||||
if (isSnap) {
|
||||
log.warn('gdbus idle monitor failed in snap environment', error);
|
||||
return null;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
|
||||
// Parse the response - gdbus format: (uint64 1234567890,)
|
||||
// dbus-send format: uint64 1234567890
|
||||
|
|
|
|||
|
|
@ -114,8 +114,9 @@ export const startApp = (): void => {
|
|||
|
||||
const enableSwiftshaderFallback = (): void => {
|
||||
log('Snap: Forcing Chromium SwiftShader software renderer fallback');
|
||||
process.env.ELECTRON_ENABLE_SWIFTSHADER = '1';
|
||||
app.commandLine.appendSwitch('use-angle', 'swiftshader');
|
||||
app.commandLine.appendSwitch('use-gl', 'swiftshader');
|
||||
app.commandLine.appendSwitch('use-gl', 'angle');
|
||||
app.commandLine.appendSwitch('enable-webgl');
|
||||
app.commandLine.appendSwitch('ignore-gpu-blacklist');
|
||||
app.commandLine.appendSwitch('ignore-gpu-blocklist');
|
||||
|
|
@ -134,6 +135,14 @@ export const startApp = (): void => {
|
|||
} else {
|
||||
canUseSnapSoftwareRenderer = ensureSnapSoftwareRendering();
|
||||
}
|
||||
app.on('gpu-process-crashed', () => {
|
||||
if (!app.commandLine.hasSwitch('disable-gpu')) {
|
||||
log('Snap: GPU process crashed, disabling GPU and relaunching');
|
||||
app.commandLine.appendSwitch('disable-gpu');
|
||||
app.relaunch();
|
||||
app.exit(0);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (isSnap && !isForceGpu && canUseSnapSoftwareRenderer) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue