summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2021-04-01 17:03:13 +0200
committerCarlos Garnacho <carlosg@gnome.org>2021-04-01 18:27:52 +0200
commitb360b08fd90eac6be799956cab7b85b55f4108cd (patch)
tree29badd8c844320dee723c9726913a04ec0335cd1
parent687b84c90a7ce4a5c16ddd4d4c1de2aec950923d (diff)
downloadgnome-shell-wip/carlosg/startup-overview-check.tar.gz
layout: Add check about whether session should start on Overviewwip/carlosg/startup-overview-check
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
-rw-r--r--js/ui/layout.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/js/ui/layout.js b/js/ui/layout.js
index 70ece6cab..13327f240 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({