[gnome-shell] Add support for respawning Compiz



commit 0857377f821eb709d6386f87db43a34d83e58180
Author: Siegfried Gevatter <rainct ubuntu com>
Date:   Mon Apr 6 18:41:57 2009 +0200

    Add support for respawning Compiz
    
    If you start gnome-shell while Compiz is running, respawn it instead
    of Metacity when gnome-shell ends.
    
    http://bugzilla.gnome.org/show_bug.cgi?id=578148
---
 src/gnome-shell.in |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/gnome-shell.in b/src/gnome-shell.in
index a5dc96d..ffbdeec 100755
--- a/src/gnome-shell.in
+++ b/src/gnome-shell.in
@@ -222,6 +222,7 @@ if options.wide:
     options.geometry = "1280x800"
 
 metacity_pid = pidof("metacity")
+compiz_pid = pidof("compiz.real") or pidof("compiz")
 gnome_panel_pid = pidof("gnome-panel")
 
 # Run in Xephyr if gnome-panel is already running and the user didn't
@@ -229,7 +230,8 @@ gnome_panel_pid = pidof("gnome-panel")
 if options.replace:
     run_in_xephyr = False
 else:
-    run_in_xephyr = (metacity_pid != None or gnome_panel_pid != None)
+    run_in_xephyr = (metacity_pid != None or compiz_pid != None or
+        gnome_panel_pid != None)
 
 # Figure out whether or not to use GL_EXT_texture_from_pixmap. By default
 # we use it iff we aren't running Xephyr, but we allow the user to
@@ -272,12 +274,17 @@ except KeyboardInterrupt, e:
         print "Shell killed"
 
 finally:
-    if not run_in_xephyr and (metacity_pid or gnome_panel_pid):
+    if not run_in_xephyr:
         # Restart gnome-panel and window manager
-        if options.verbose:
-            print "Restarting Metacity and Gnome Panel"
-        
         if metacity_pid:
+            if options.verbose:
+                print "Restarting Metacity"
             subprocess.Popen(["/usr/bin/metacity"])
+        elif compiz_pid:
+            if options.verbose:
+                print "Restarting Compiz"
+            subprocess.Popen(["/usr/bin/compiz"])
         if gnome_panel_pid:
+            if options.verbose:
+                print "Restarting gnome-panel"
             subprocess.Popen(["/usr/bin/gnome-panel"])



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