[gnome-shell/wip/carlosg/startup-overview-check] layout: Add check about whether session should start on Overview




commit 1bfecdb12de0db637da784b030f10b55d1544c91
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Apr 1 17:03:13 2021 +0200

    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 | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/layout.js b/js/ui/layout.js
index 70ece6cab8..9a9a2c366e 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -292,6 +292,12 @@ var LayoutManager = GObject.registerClass({
         monitorManager.connect('monitors-changed',
                                this._monitorsChanged.bind(this));
         this._monitorsChanged();
+
+        const fileName =
+              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 +671,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 +712,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({


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]