From b360b08fd90eac6be799956cab7b85b55f4108cd Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 1 Apr 2021 17:03:13 +0200 Subject: [PATCH] layout: Add check about whether session should start on Overview In situations that there are UI applications that are meant to be started together with the session, it is undesirable to boot into the overview. In ideal situations, we would have session management infrastructure in place that would allow GNOME Shell to find out there's UI services to be brought up in the startup phase, and be able to decide window positions and workspaces beforehand. But we don't have any of that. Add a sneaky file existence test so the behavior can be tweaked by savvy users and e.g. installers. The hope being that this is a temporary solution till we have the ideal framework in place. Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3854 --- js/ui/layout.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/js/ui/layout.js b/js/ui/layout.js index 70ece6cab8..13327f2404 100644 --- a/js/ui/layout.js +++ b/js/ui/layout.js @@ -292,6 +292,15 @@ var LayoutManager = GObject.registerClass({ monitorManager.connect('monitors-changed', this._monitorsChanged.bind(this)); this._monitorsChanged(); + + const fileName = GLib.build_filenamev([ + GLib.get_user_config_dir(), + 'gnome-shell', + 'prevent-overview', + ]); + this._startupIntoOverview = + Main.sessionMode.hasOverview && + !GLib.file_test(fileName, GLib.FileTest.EXISTS); } // This is called by Main after everything else is constructed @@ -665,7 +674,7 @@ var LayoutManager = GObject.registerClass({ let monitor = this.primaryMonitor; - if (!Main.sessionMode.hasOverview) { + if (!this._startupIntoOverview) { const x = monitor.x + monitor.width / 2.0; const y = monitor.y + monitor.height / 2.0; @@ -706,7 +715,7 @@ var LayoutManager = GObject.registerClass({ _startupAnimationSession() { const onComplete = () => this._startupAnimationComplete(); - if (Main.sessionMode.hasOverview) { + if (this._startupIntoOverview) { Main.overview.runStartupAnimation(onComplete); } else { this.uiGroup.ease({ -- GitLab