1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-11 18:24:43 +02:00

Desktop: Fixes #9045: Ubuntu: Fix window sometimes doesn't appear on startup (#9561)

This commit is contained in:
Henry Heino 2023-12-20 11:09:28 -08:00 committed by GitHub
parent 674bbf9667
commit 3b4eb16110
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,10 +69,26 @@ const shim = {
},
isGNOME: () => {
if ((!shim.isLinux() && !shim.isFreeBSD()) || !process) {
return false;
}
const currentDesktop = process.env['XDG_CURRENT_DESKTOP'] ?? '';
// XDG_CURRENT_DESKTOP may be something like "ubuntu:GNOME" and not just "GNOME".
// Thus, we use .includes and not ===.
return (shim.isLinux() || shim.isFreeBSD())
&& process && (process.env['XDG_CURRENT_DESKTOP'] ?? '').includes('GNOME');
if (currentDesktop.includes('GNOME')) {
return true;
}
// On Ubuntu, "XDG_CURRENT_DESKTOP=ubuntu:GNOME" is replaced with "Unity" and
// ORIGINAL_XDG_CURRENT_DESKTOP stores the original desktop.
const originalCurrentDesktop = process.env['ORIGINAL_XDG_CURRENT_DESKTOP'] ?? '';
if (originalCurrentDesktop.includes('GNOME')) {
return true;
}
return false;
},
isFreeBSD: () => {