[gnome-shell] main: Use session mode property for welcome dialog
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] main: Use session mode property for welcome dialog
- Date: Tue, 6 Apr 2021 19:02:44 +0000 (UTC)
commit e6be180df1673fefe31ac93dc5983dfad850ecdb
Author: Florian Müllner <fmuellner gnome org>
Date: Mon Apr 5 19:36:29 2021 +0200
main: Use session mode property for welcome dialog
We only want to show the welcome dialog in the user session, not
on the login screen or during initial setup. We currently achieve
that by explicitly checking for those mode names, but there are
other modes like gnome-classic where the dialog is equally un-
helpful. Support those cases by adding a session mode property
that determines whether the welcome dialog should be enabled,
so that modes can opt in or out of the feature themselves.
(Both the 'gdm' and 'initial-setup' modes are based on the
'restricted' mode, so this change does not affect them)
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4026
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1793>
js/ui/main.js | 3 +--
js/ui/sessionMode.js | 2 ++
2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/main.js b/js/ui/main.js
index bf7b6acc1a..979fcefa5d 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -293,8 +293,7 @@ function _initializeUI() {
if (credentials.get_unix_user() === 0) {
notify(_('Logged in as a privileged user'),
_('Running a session as a privileged user should be avoided for security reasons. If
possible, you should log in as a normal user.'));
- } else if (sessionMode.currentMode !== 'gdm' &&
- sessionMode.currentMode !== 'initial-setup') {
+ } else if (sessionMode.showWelcomeDialog) {
_handleShowWelcomeScreen();
}
diff --git a/js/ui/sessionMode.js b/js/ui/sessionMode.js
index 2136e948f1..aa69fd1152 100644
--- a/js/ui/sessionMode.js
+++ b/js/ui/sessionMode.js
@@ -19,6 +19,7 @@ const _modes = {
themeResourceName: 'gnome-shell-theme.gresource',
hasOverview: false,
showCalendarEvents: false,
+ showWelcomeDialog: false,
allowSettings: false,
allowExtensions: false,
allowScreencast: false,
@@ -70,6 +71,7 @@ const _modes = {
'user': {
hasOverview: true,
showCalendarEvents: true,
+ showWelcomeDialog: true,
allowSettings: true,
allowExtensions: true,
allowScreencast: true,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]