From 5bb9843217002c051d3b51ffc6250232e5da2a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 28 Nov 2022 16:44:18 +0100 Subject: [PATCH] ui/main: Don't show welcome screen or root warning with perf tests If we want to run with the welcome screen showing, it should be done so explicitly. Hide it if there is a perf test running for now, so that what we test is what is expected to be tested. We also don't want to show the root user warning, since we'll be running as root in the CI containers. Part-of: --- js/ui/main.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/js/ui/main.js b/js/ui/main.js index 2d8804aca..b6f54da9e 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -329,12 +329,16 @@ function _initializeUI() { }); } - let credentials = new Gio.Credentials(); - 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.showWelcomeDialog) { - _handleShowWelcomeScreen(); + const perfModuleName = GLib.getenv('SHELL_PERF_MODULE'); + if (!perfModuleName) { + let credentials = new Gio.Credentials(); + 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.showWelcomeDialog) { + _handleShowWelcomeScreen(); + } } if (sessionMode.currentMode !== 'gdm' && @@ -343,7 +347,6 @@ function _initializeUI() { LoginManager.registerSessionWithGDM(); - let perfModuleName = GLib.getenv("SHELL_PERF_MODULE"); if (perfModuleName) { let perfOutput = GLib.getenv("SHELL_PERF_OUTPUT"); let module = eval(`imports.perf.${perfModuleName};`);