[gnome-session] [gnome-wm] Prefer compiz-manager over compiz when available



commit 0831c925b675f84a4258c1b9ebb6c46d1dadca13
Author: Vincent Untz <vuntz gnome org>
Date:   Tue Jul 21 15:57:02 2009 +0200

    [gnome-wm] Prefer compiz-manager over compiz when available
    
    compiz-manager is able to detect if compiz can be run, and knows how to
    launch it, so it's a better solution than handling compiz ourselves.

 data/gnome-wm |   27 +++++++++++++++++++++------
 1 files changed, 21 insertions(+), 6 deletions(-)
---
diff --git a/data/gnome-wm b/data/gnome-wm
index 521b51b..5b961ce 100755
--- a/data/gnome-wm
+++ b/data/gnome-wm
@@ -45,6 +45,19 @@ if [ -z "$WINDOW_MANAGER" ] ; then
     WINDOW_MANAGER=`gconftool-2 --get /desktop/gnome/session/required_components/windowmanager 2> /dev/null`
 fi
 
+# Migrate compiz to compiz-manager if possible and needed
+if [ "x$WINDOW_MANAGER" = "xcompiz" -o "x$DEFWM" = "xcompiz" ]; then
+  which compiz-manager > /dev/null 2>&1
+  if [ $? -eq 0 ]; then
+    if [ "x$WINDOW_MANAGER" = "xcompiz" ]; then
+      WINDOW_MANAGER="compiz-manager"
+    fi
+    if [ "x$DEFWM" = "xcompiz" ]; then
+      DEFWM="compiz-manager"
+    fi
+  fi
+fi
+
 # Avoid looping if the session configuration tells us to use gnome-wm or if
 # the user forces gnome-wm via WINDOW_MANAGER
 if [ "x$WINDOW_MANAGER" = "xgnome-wm" ]; then
@@ -60,23 +73,25 @@ if [ -z "$WINDOW_MANAGER" ] ; then
 
   KNOWN_WM="sawfish sawmill enlightenment icewm wmaker fvwm2 qvwm fvwm twm kwm"
   if [ $IS_X_COMPOSITED -eq 0 ] ; then
-    KNOWN_WM="mutter compiz beryl $KNOWN_WM"
+    KNOWN_WM="mutter compiz-manager compiz beryl $KNOWN_WM"
   fi
   # metacity is still the default wm in GNOME
   KNOWN_WM="metacity $KNOWN_WM"
 
   OLDIFS=$IFS
   if [ -z "$DEFWM" -o "x$DEFWM" = "xgnome-wm" ]; then
+
     for wm in $KNOWN_WM ; do
       IFS=":"
       for dir in $PATH ; do
-	if [ -x "$dir/$wm" ] ; then
-	  WINDOW_MANAGER="$dir/$wm"
-    	  break 2
-	fi
+        if [ -x "$dir/$wm" ] ; then
+          WINDOW_MANAGER="$dir/$wm"
+          break 2
+        fi
       done
       IFS=$OLDIFS
     done
+
   else
     WINDOW_MANAGER=$DEFWM
   fi
@@ -116,7 +131,7 @@ if [ ! -z "$SMID" ] ; then
       OPT1=-i
       OPT2=$SMID
       ;;
-    compiz)
+    compiz|compiz-manager)
       OPT1=--sm-client-id
       OPT2=$SMID
       ;;



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