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

Desktop: Fixes #8256: Don't start window minimized in GNOME (#8441)

This commit is contained in:
Henry Heino 2023-07-10 03:59:09 -07:00 committed by GitHub
parent 383e9d4e46
commit 7ef591f3a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -100,7 +100,10 @@ export default class ElectronAppWrapper {
webviewTag: true,
// We start with a hidden window, which is then made visible depending on the showTrayIcon setting
// https://github.com/laurent22/joplin/issues/2031
show: debugEarlyBugs,
//
// On Linux/GNOME, however, the window doesn't show correctly if show is false initially:
// https://github.com/laurent22/joplin/issues/8256
show: debugEarlyBugs || shim.isGNOME(),
};
// Linux icon workaround for bug https://github.com/electron-userland/electron-builder/issues/2098

View File

@ -494,7 +494,7 @@ class Application extends BaseApplication {
}, 1000 * 60 * 60);
if (Setting.value('startMinimized') && Setting.value('showTrayIcon')) {
// Keep it hidden
bridge().window().hide();
} else {
bridge().window().show();
}

View File

@ -57,6 +57,13 @@ const shim = {
return process && process.platform === 'linux';
},
isGNOME: () => {
// 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');
},
isFreeBSD: () => {
return process && process.platform === 'freebsd';
},