Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions packages/lib/shim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: () => {
Expand Down
Loading