summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJigish Gohil <cyberorg@opensuse.org>2008-10-16 21:34:20 +0530
committerJigish Gohil <cyberorg@opensuse.org>2008-10-16 21:34:20 +0530
commitfefd84266208def2be5079aec0dc7ee8e79a31f0 (patch)
tree2f4fc8c90a6359bd0c6ee9d507b3af5707b2de02
parent6edfc553c4597f7ea5ed24a8f0d274fbf549341d (diff)
downloadmisc-fefd84266208def2be5079aec0dc7ee8e79a31f0.tar.gz
misc-fefd84266208def2be5079aec0dc7ee8e79a31f0.tar.bz2
use xdg way for fallback
-rw-r--r--compiz-manager69
1 files changed, 32 insertions, 37 deletions
diff --git a/compiz-manager b/compiz-manager
index ad733e0..87e9f6d 100644
--- a/compiz-manager
+++ b/compiz-manager
@@ -43,13 +43,14 @@ fi
GLXINFO="/usr/bin/glxinfo"
KWIN=`which kwin`
METACITY="/usr/bin/metacity"
+XFWM="/usr/bin/xfwm"
COMPIZ_NAME="compiz" # Final name for compiz (compiz.real)
FUSION_ICON=`which fusion-icon`
# For Xgl LD_PRELOAD
LIBGL_NVIDIA=""
LIBGL_FGLRX=""
-
+LD_LIBRARY_PATH=/usr/X11R6/$LIB/
# Minimum amount of memory (in kilo bytes) that nVidia cards need
# to be allowed to start
# Set to 262144 to require 256MB
@@ -58,17 +59,15 @@ NVIDIA_SETTINGS="nvidia-settings" # Assume it's in the path by default
# For detecting what driver is in use, the + is for one or more /'s
XORG_DRIVER_PATH="/usr/$LIB/xorg/modules/drivers/+"
-
-if [ $DESKTOP_SESSION == "kde" ]; then
- FALLBACKWM="${KWIN}"
-else
- FALLBACKWM="${METACITY}"
+if [ x"$KDE_FULL_SESSION" = x"true" ]; then FALLBACKWM="${KWIN}";
+ elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then FALLBACKWM="${METACITY}";
+ elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then FALLBACKWM="${XFWM}";
fi
FALLBACKWM_OPTIONS="--replace $@"
# Driver whitelist
-WHITELIST="nvidia intel ati radeon i810 fglrx"
+WHITELIST="nvidia intel i810 fglrx"
# blacklist based on the pci ids
# See http://wiki.compiz-fusion.org/Hardware/Blacklist for details
@@ -78,12 +77,12 @@ T="$T 8086:2982 8086:2992 8086:29a2 8086:2a02 8086:2a12" # intel 965
BLACKLIST_PCIIDS="$T"
unset T
-COMPIZ_OPTIONS="--ignore-desktop-hints --replace"
+COMPIZ_OPTIONS="--ignore-desktop-hints "
COMPIZ_PLUGINS=""
ENV=""
# Use emerald by default if it exist
-USE_EMERALD="yes"
+USE_EMERALD=""
# No indirect by default
INDIRECT="no"
@@ -199,6 +198,19 @@ check_composite()
fi
}
+# Detects if Xdmx is running
+check_xdmx()
+{
+ verbose "Checking for Xdmx: "
+ if xdpyinfo | grep -q DMX ; then
+ verbose "present. \n"
+ return 0;
+ else
+ verbose "not present. \n"
+ return 1;
+ fi
+}
+
# Detects if Xgl is running
check_xgl()
{
@@ -274,12 +286,7 @@ running_under_whitelisted_driver()
if egrep -q "Loading .*${DRV}_drv\.so" $LOG &&
! egrep -q "Unloading .*${DRV}_drv\.so" $LOG;
then
-# if [ x"$DRV" = x"nvidia" -o x"$DRV" = x"fglrx" ]; then
-# COMPIZ_OPTIONS="--no-libgl-fallback --ignore-desktop-hints --replace"
-# LIBGL_ALWAYS_INDIRECT=1
-# LD_LIBRARY_PATH=/usr/X11R6/lib
-# fi
- return 0
+ return 0
fi
done
verbose "No whitelisted driver found\n"
@@ -364,8 +371,16 @@ if [ "x$LIBGL_ALWAYS_INDIRECT" = "x1" ]; then
INDIRECT="yes";
fi
+# if we run under Xdmx
+if check_xdmx; then
+ # check if we have the required bits to run compiz and if not,
+ # fallback
+ if ! check_composite; then
+ abort_with_fallback_wm
+ fi
+
# if we run under Xgl, we can skip some tests here
-if ! check_xgl; then
+elif ! check_xgl; then
# if vesa or vga are in use, do not even try glxinfo (LP#119341)
if ! running_under_whitelisted_driver || have_blacklisted_pciid; then
abort_with_fallback_wm
@@ -389,7 +404,7 @@ fi
if [ -f ${PLUGIN_PATH}libccp.so ]; then
COMPIZ_PLUGINS="$COMPIZ_PLUGINS ccp"
elif [ -f ${PLUGIN_PATH}libgconf.so ]; then
- COMPIZ_PLUGINS="$COMPIZ_PLUGINS glib gconf"
+ COMPIZ_PLUGINS="$COMPIZ_PLUGINS core glib gconf"
fi
# get environment
@@ -401,26 +416,6 @@ if [ "x$CM_DRY" = "xyes" ]; then
exit 0;
fi
-if [ -f $HOME/.config/compiz/disable-compiz ]; then
- abort_with_fallback_wm
-fi
-
-# start the gtk-window-decorator if present
-if [ -x ${COMPIZ_BIN_PATH}emerald ] && [ "$USE_EMERALD" = "yes" ]; then
- verbose "Starting emerald\n"
- pgrep emerald || ${COMPIZ_BIN_PATH}emerald --replace &
-elif [ -x ${COMPIZ_BIN_PATH}gtk-window-decorator ] && [ -n "$GNOME_DESKTOP_SESSION_ID" ]; then
- verbose "Starting gtk-window-decorator\n"
- pgrep gtk-window-decorator || ${COMPIZ_BIN_PATH}gtk-window-decorator --replace &
- FALLBACKWM="${METACITY}"
-elif [ -x ${COMPIZ_BIN_PATH}kde-window-decorator ] && [ -n "$KDE_FULL_SESSION" ]; then
- verbose "Starting kde-window-decorator\n"
- pgrep kde-window-decorator || ${COMPIZ_BIN_PATH}kde-window-decorator --replace &
- FALLBACKWM="${KWIN}"
-elif [ -x ${COMPIZ_BIN_PATH}kde4-window-decorator ] && [ x$KDE_SESSION_VERSION = x"4" ]; then
- pgrep kde4-window-decorator || ${COMPIZ_BIN_PATH}kde4-window-decorator --replace &
-fi
-
if [ x$FUSION_ICON = "x/usr/bin/fusion-icon" ] ; then
pgrep fusion-icon || ${FUSION_ICON} -n &
fi