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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2560>
This commit is contained in:
Jonas Ådahl 2022-11-28 16:44:18 +01:00
parent 5aa95007de
commit 5bb9843217

View File

@ -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};`);