summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <wjt@endlessos.org>2022-08-16 07:07:16 +0100
committerWill Thompson <wjt@endlessos.org>2022-08-16 10:56:13 +0100
commit2256173f6c410076973d6fca3c6c163417f1b65d (patch)
tree3cc0e173c095fd39e0ef8928eeae91239182f1b2
parent1c2e320713a0b0474577b0776df67839071d07d9 (diff)
downloadgnome-shell-wip/wjt/dont-set-welcome-dialog-last-shown-if-tour-not-installed.tar.gz
main: Only set last-shown-version if welcome actually shownwip/wjt/dont-set-welcome-dialog-last-shown-if-tour-not-installed
At startup, if the welcome-dialog-last-shown-version GSetting compares older than WELCOME_DIALOG_LAST_TOUR_CHANGE, Shell attempts to offer the welcome tour to the user, and then sets that GSetting to the current version of Shell. However, showing the welcome dialog can fail. In particular, if gnome-tour is not installed, WelcomeDialog.open() returns false and the dialog is not shown; but there are other reasons, such as another modal dialog already being open. Previously, welcome-dialog-last-shown-version would nonetheless be updated in this case, so if you subsequently install gnome-tour (or on the next login, if there is no modal dialog), the welcome dialog will not be offered until the next time WELCOME_DIALOG_LAST_TOUR_CHANGE is bumped. Instead, check whether WelcomeDialog.open() fails; if so, don't update welcome-dialog-last-shown-version.
-rw-r--r--js/ui/main.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/js/ui/main.js b/js/ui/main.js
index 2d8804aca..e1862c82e 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -354,10 +354,9 @@ function _initializeUI() {
function _handleShowWelcomeScreen() {
const lastShownVersion = global.settings.get_string(WELCOME_DIALOG_LAST_SHOWN_VERSION);
- if (Util.GNOMEversionCompare(WELCOME_DIALOG_LAST_TOUR_CHANGE, lastShownVersion) > 0) {
- openWelcomeDialog();
+ if (Util.GNOMEversionCompare(WELCOME_DIALOG_LAST_TOUR_CHANGE, lastShownVersion) > 0 &&
+ openWelcomeDialog())
global.settings.set_string(WELCOME_DIALOG_LAST_SHOWN_VERSION, Config.PACKAGE_VERSION);
- }
}
async function _handleLockScreenWarning() {
@@ -710,7 +709,7 @@ function openWelcomeDialog() {
if (welcomeDialog === null)
welcomeDialog = new WelcomeDialog.WelcomeDialog();
- welcomeDialog.open();
+ return welcomeDialog.open();
}
/**