diff -aurp gnome-session-2.22.1.1/gnome-session/gnome-wm gnome-session-2.22.1.1-patched/gnome-session/gnome-wm --- gnome-session-2.22.1.1/gnome-session/gnome-wm 2008-04-10 16:32:20.000000000 +0200 +++ gnome-session-2.22.1.1-patched/gnome-session/gnome-wm 2008-05-05 11:22:33.628080000 +0200 @@ -39,6 +39,14 @@ done # WINDOW_MANAGER overrides all +# Migrate compiz to compiz-manager +if [ "x$WINDOW_MANAGER" = "xcompiz" ]; then + WINDOW_MANAGER="compiz-manager" +fi +if [ "x$DEFWM" = "xcompiz" ]; then + DEFWM="compiz-manager" +fi + if [ -z "$WINDOW_MANAGER" ] ; then # Create a list of window manager we can handle, trying to only use the # compositing ones when it makes sense @@ -46,15 +54,21 @@ if [ -z "$WINDOW_MANAGER" ] ; then xdpyinfo 2> /dev/null | grep -q "^ *Composite$" 2> /dev/null IS_X_COMPOSITED=$? - KNOWN_WM="sawfish sawmill enlightenment icewm wmaker fvwm2 qvwm fvwm twm kwm" - if [ $IS_X_COMPOSITED -eq 0 ] ; then - KNOWN_WM="compiz beryl $KNOWN_WM" + if [ "x$XDG_CONFIG_HOME" = "x" ]; then + COMPIZ_ENABLED_FILE="$HOME/.config/compiz/enable/enable-compiz" + else + COMPIZ_ENABLED_FILE="$XDG_CONFIG_HOME/compiz/enable/enable-compiz" + fi + + KNOWN_WM="metacity sawfish sawmill enlightenment icewm wmaker fvwm2 qvwm fvwm twm kwm" + + if [ -f "$COMPIZ_ENABLED_FILE" -a $IS_X_COMPOSITED -eq 0 ] ; then + KNOWN_WM="compiz-manager $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 @@ -65,6 +79,7 @@ if [ -z "$WINDOW_MANAGER" ] ; then done IFS=$OLDIFS done + else WINDOW_MANAGER=$DEFWM fi @@ -104,11 +119,7 @@ if [ ! -z "$SMID" ] ; then OPT1=-i OPT2=$SMID ;; - compiz) - OPT1=--sm-client-id - OPT2=$SMID - ;; - beryl) + compiz-manager) OPT1=--sm-client-id OPT2=$SMID ;; @@ -116,18 +127,6 @@ if [ ! -z "$SMID" ] ; then esac fi -case `basename $WINDOW_MANAGER` in - compiz) - export LIBGL_ALWAYS_INDIRECT=1 - gtk-window-decorator & - OPT3=glib - OPT4=gconf - ;; - beryl) - emerald & - ;; -esac - -exec $WINDOW_MANAGER $OPT1 $OPT2 $OPT3 $OPT4 +exec $WINDOW_MANAGER $OPT1 $OPT2 echo "ERROR: No window manager could run!"