[gnome-shell] Initialize ShellAppMonitor/ShellAppSystem at predicatable time



commit d17c94f9b98a76b2ff4041e94c95f22da7ba8254
Author: Colin Walters <walters verbum org>
Date:   Wed Aug 12 13:32:54 2009 -0400

    Initialize ShellAppMonitor/ShellAppSystem at predicatable time
    
    Currently ShellAppMonitor relies on all the .desktop files being
    loaded.  We should initialize it very early to ensure that anything
    that uses it has up-to-date information right away.

 js/ui/main.js |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/main.js b/js/ui/main.js
index b9e1c86..4bae932 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -40,6 +40,16 @@ function start() {
 
     Tweener.init();
 
+    // Ensure ShellAppMonitor is initialized; this will
+    // also initialize ShellAppSystem first.  ShellAppSystem
+    // needs to load all the .desktop files, and ShellAppMonitor
+    // will use those to associate with windows.  Right now
+    // the Monitor doesn't listen for installed app changes
+    // and recalculate application associations, so to avoid
+    // races for now we initialize it here.  It's better to
+    // be predictable anyways.
+    Shell.AppMonitor.get_default();
+
     // The background color really only matters if there is no desktop
     // window (say, nautilus) running. We set it mostly so things look good
     // when we are running inside Xephyr.
@@ -64,7 +74,7 @@ function start() {
     panel = new Panel.Panel();
     sidebar = new Sidebar.Sidebar();
     wm = new WindowManager.WindowManager();
-    
+
     global.screen.connect('toggle-recording', function() {
         if (recorder == null) {
             recorder = new Shell.Recorder({ stage: global.stage });



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