[gnome-shell/T27795: 72/138] overview: Switch to the apps page when startup is completed if needed



commit f573f84cf9f7ff6038aefdaea0daf178eefbfdbe
Author: Mario Sanchez Prada <mario endlessm com>
Date:   Wed Jan 31 20:35:54 2018 +0000

    overview: Switch to the apps page when startup is completed if needed
    
    Trying to switch earlier than this might result in the shell staying
    in a funny state, that causes strange effects and bugs, such as showing
    windows in something like the window picker mode (but that it's not
    properly initialized) or preventing the DnD operations from working
    due to the wrong hierarchy of visible Clutter actors hanging off the
    root stage object.
    
    Also, don't show the overview at startup if windows are visible, which
    could cause some also funny situations when restarting the shell.
    
    https://phabricator.endlessm.com/T17789
    https://phabricator.endlessm.com/T18032
    https://phabricator.endlessm.com/T19778

 js/ui/overview.js     | 5 +++++
 js/ui/viewSelector.js | 5 +++++
 2 files changed, 10 insertions(+)
---
diff --git a/js/ui/overview.js b/js/ui/overview.js
index cbdd18a773..7c11678946 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -242,6 +242,7 @@ var Overview = class {
         });
 
         this.viewSelector.connect('page-changed', this._onPageChanged.bind(this));
+        Main.layoutManager.connect('startup-prepared', this._onStartupPrepared.bind(this));
         Main.layoutManager.connect('monitors-changed', this._relayout.bind(this));
         this._relayout();
     }
@@ -455,6 +456,10 @@ var Overview = class {
         this._showOrSwitchPage(ViewSelector.ViewPage.WINDOWS);
     }
 
+    _onStartupPrepared() {
+        this.showApps();
+    }
+
     fadeInDesktop() {
         this._desktopFade.opacity = 0;
         this._desktopFade.show();
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 3443663b2b..a886fa7b1a 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -209,6 +209,11 @@ var ViewSelector = class {
                 this._workspacesPage.opacity = 0;
                 this._workspacesPage.hide();
             }
+
+            // Make sure to hide the overview immediately if we're starting up
+            // coming from a previous session with apps running and visible.
+            if (Main.layoutManager.startingUp && Main.workspaceMonitor.hasVisibleWindows)
+                Main.overview.hide();
         });
 
         Main.wm.addKeybinding('toggle-application-view',


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