diff options
Diffstat (limited to 'x11-wm/compiz/files')
-rwxr-xr-x | x11-wm/compiz/files/compiz-manager.in | 407 | ||||
-rw-r--r-- | x11-wm/compiz/files/patch-gtk_window-decorator_gtk-window-decorator.c | 61 | ||||
-rw-r--r-- | x11-wm/compiz/files/patch-plugins_fuse.c | 11 | ||||
-rw-r--r-- | x11-wm/compiz/files/patch-plugins_png.c | 29 |
4 files changed, 0 insertions, 508 deletions
diff --git a/x11-wm/compiz/files/compiz-manager.in b/x11-wm/compiz/files/compiz-manager.in deleted file mode 100755 index adfd309d3..000000000 --- a/x11-wm/compiz/files/compiz-manager.in +++ /dev/null @@ -1,407 +0,0 @@ -#!/bin/sh -# Compiz Manager wrapper script -# -# Copyright (c) 2007 Kristian Lyngstøl <kristian@bohemians.org> -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# -# -# Contributions by: Treviño (3v1n0) <trevi55@gmail.com>, Ubuntu Packages -# -# Much of this code is based on Beryl code, also licensed under the GPL. -# This script will detect what options we need to pass to compiz to get it -# started, and start a default plugin and possibly window decorator. -# - - -COMPIZ_BIN_PATH="%%LOCALBASE%%/bin/" # For window decorators and compiz -PLUGIN_PATH="%%LOCALBASE%%/lib/compiz/" -GLXINFO="%%LOCALBASE%%/bin/glxinfo" -KWIN="%%LOCALBASE%%/bin/kwin" -METACITY="%%LOCALBASE%%/bin/metacity" -XFWM="%%LOCALBASE%%/bin/xfwm" -COMPIZ_NAME="compiz" # Final name for compiz (compiz.real) - -# For Xgl LD_PRELOAD -LIBGL_NVIDIA="/usr/lib/nvidia/libGL.so.1.2.xlibmesa" -LIBGL_FGLRX="/usr/lib/fglrx/libGL.so.1.2.xlibmesa" - -# Minimum amount of memory (in kilo bytes) that nVidia cards need -# to be allowed to start -# Set to 262144 to require 256MB -NVIDIA_MEMORY="65536" # 64MB -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="%%LOCALBASE%%/lib/xorg/modules/drivers/+" -FALLBACKWM="xterm" -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" - -# blacklist based on the pci ids -# See http://wiki.compiz-fusion.org/Hardware/Blacklist for details -T=" 1002:5954 1002:5854 1002:5955" # ati rs480 -T="$T 1002:4153" # ATI Rv350 -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_PLUGINS="" -ENV="" - -# Use emerald by default if it exist -USE_EMERALD="yes" - -# No indirect by default -INDIRECT="no" - -# Default X.org log if xset q doesn't reveal it -XORG_DEFAULT_LOG="/var/log/Xorg.0.log" - -# Set to yes to enable verbose -VERBOSE="yes" - -# Echos the arguments if verbose -verbose() -{ - if [ "x$VERBOSE" = "xyes" ]; then - printf "$*" - fi -} - -# abort script and run fallback windowmanager -abort_with_fallback_wm() -{ - if [ "x$SKIP_CHECKS" = "xyes" ]; then - verbose "SKIP_CHECKS is yes, so continuing despite problems.\n" - return 0; - fi - - if [ "x$CM_DRY" = "xyes" ]; then - verbose "Dry run failed: Problems detected with 3D support.'n" - exit 1; - fi - - verbose "aborting and using fallback: $FALLBACKWM \n" - - if [ -x $FALLBACKWM ]; then - exec $FALLBACKWM $FALLBACKWM_OPTIONS - else - printf "no $FALLBACKWM found, exiting\n" - exit 1 - fi -} - -# Check for non power of two texture support -check_npot_texture() -{ - verbose "Checking for non power of two support: " - if glxinfo 2> /dev/null | egrep -q '(GL_ARB_texture_non_power_of_two|GL_NV_texture_rectangle|GL_EXT_texture_rectangle|GL_ARB_texture_rectangle)' ; then - verbose "present. \n"; - return 0; - else - verbose "Not present. \n" - return 1; - fi - -} - -# Check for presence of FBConfig -check_fbconfig() -{ - verbose "Checking for FBConfig: " - if [ "$INDIRECT" = "yes" ]; then - $GLXINFO -i | grep -q GLX.*fbconfig - FB=$? - else - $GLXINFO | grep -q GLX.*fbconfig - FB=$? - fi - - if [ $FB = "0" ]; then - unset FB - verbose "present. \n" - return 0; - else - unset FB - verbose "not present. \n" - return 1; - fi -} - - -# Check for TFP -check_tfp() -{ - verbose "Checking for texture_from_pixmap: " - if [ $($GLXINFO 2>/dev/null | grep -c GLX_EXT_texture_from_pixmap) -gt 2 ] ; then - verbose "present. \n" - return 0; - else - verbose "not present. \n" - if [ "$INDIRECT" = "yes" ]; then - unset LIBGL_ALWAYS_INDIRECT - INDIRECT="no" - return 1; - else - verbose "Trying again with indirect rendering:\n"; - INDIRECT="yes" - export LIBGL_ALWAYS_INDIRECT=1 - check_tfp; - return $? - fi - fi -} - -# Check wether the composite extension is present -check_composite() -{ - verbose "Checking for Composite extension: " - if xdpyinfo -queryExtensions | grep -q Composite ; then - verbose "present. \n"; - return 0; - else - verbose "not present. \n"; - return 1; - fi -} - -# Detects if Xgl is running -check_xgl() -{ - verbose "Checking for Xgl: " - if xvinfo | grep -q Xgl ; then - verbose "present. \n" - return 0; - else - verbose "not present. \n" - return 1; - fi -} - -# Check if the nVidia card has enough video ram to make sense -check_nvidia_memory() -{ - MEM=$(${NVIDIA_SETTINGS} -q VideoRam | egrep Attribute\ \'VideoRam\'\ .*: | cut -d: -f3 | sed 's/[^0-9]//g') - if [ $MEM -lt $NVIDIA_MEMORY ]; then - verbose "Less than ${NVIDIA_MEMORY}kb of memory and nVidia"; - return 1; - fi - return 0; -} - -# Check for existence if NV-GLX -check_nvidia() -{ - if [ ! -z $NVIDIA_INTERNAL_TEST ]; then - return $NVIDIA_INTERNAL_TEST; - fi - verbose "Checking for nVidia: " - if xdpyinfo | grep -q NV-GLX ; then - verbose "present. \n" - NVIDIA_INTERNAL_TEST=0 - return 0; - else - verbose "not present. \n" - NVIDIA_INTERNAL_TEST=1 - return 1; - fi -} - -# Check if the max texture size is large enough compared to the resolution -check_texture_size() -{ - TEXTURE_LIMIT=$(glxinfo -l | grep GL_MAX_TEXTURE_SIZE | sed 's/.*=[^0-9]//g') - RESOLUTION=$(xdpyinfo | grep -i dimensions: | sed 's/[^0-9]*pixels.*(.*).*//' | sed 's/[^0-9x]*//') - VRES=$(echo $RESOLUTION | sed 's/.*x//') - HRES=$(echo $RESOLUTION | sed 's/x.*//') - verbose "Comparing resolution ($RESOLUTION) to maximum 3D texture size ($TEXTURE_LIMIT): "; - if [ $VRES -gt $TEXTURE_LIMIT ] || [ $HRES -gt $TEXTURE_LIMIT ]; then - verbose "Failed.\n" - return 1; - fi - verbose "Passed.\n" - return 0 -} - -# check driver whitelist -running_under_whitelisted_driver() -{ - LOG=$(xset q|grep "Log file"|awk '{print $3}') - if [ "$LOG" = "" ]; then - verbose "xset q doesn't reveal the location of the log file. Using fallback $XORG_DEFAULT_LOG \n" - LOG=$XORG_DEFAULT_LOG; - fi - if [ -z "$LOG" ];then - verbose "AIEEEEH, no Log file found \n" - verbose "$(xset q) \n" - return 0 - fi - for DRV in ${WHITELIST}; do - if egrep -q "Loading ${XORG_DRIVER_PATH}${DRV}_drv\.so" $LOG && - ! egrep -q "Unloading ${XORG_DRIVER_PATH}${DRV}_drv\.so" $LOG; - then - return 0 - fi - done - verbose "No whitelisted driver found\n" - return 1 -} - -# check pciid blacklist -have_blacklisted_pciid() -{ -# OUTPUT=$(lspci -n) -# for ID in ${BLACKLIST_PCIIDS}; do -# if echo "$OUTPUT" | egrep -q "$ID"; then -# verbose "Blacklisted PCIID '$ID' found \n" -# return 0 -# fi -# done -# OUTPUT=$(lspci -vn | grep -i VGA) -# verbose "Detected PCI ID for VGA: $OUTPUT\n" - return 1 -} - -build_env() -{ - if check_nvidia; then - ENV="__GL_YIELD=NOTHING " - fi - if [ "$INDIRECT" = "yes" ]; then - ENV="$ENV LIBGL_ALWAYS_INDIRECT=1 " - fi - if check_xgl; then - if [ -f ${LIBGL_NVIDIA} ]; then - ENV="$ENV LD_PRELOAD=${LIBGL_NVIDIA}" - verbose "Enabling Xgl with nVidia drivers...\n" - fi - if [ -f ${LIBGL_FGLRX} ]; then - ENV="$ENV LD_PRELOAD=${LIBGL_FGLRX}" - verbose "Enabling Xgl with fglrx ATi drivers...\n" - fi - fi - - ENV="$ENV FROM_WRAPPER=yes" - - if [ -n "$ENV" ]; then - export $ENV - fi -} - -build_args() -{ - if [ "x$INDIRECT" = "xyes" ]; then - COMPIZ_OPTIONS="$COMPIZ_OPTIONS --indirect-rendering " - fi - if [ ! -z "$DESKTOP_AUTOSTART_ID" ]; then - COMPIZ_OPTIONS="$COMPIZ_OPTIONS --sm-client-id $DESKTOP_AUTOSTART_ID" - fi - if check_nvidia; then - if [ "x$INDIRECT" != "xyes" ]; then - COMPIZ_OPTIONS="$COMPIZ_OPTIONS --loose-binding" - fi - fi -} - -#################### -# Execution begins here. - -# Read configuration from XDG paths -if [ -z "$XDG_CONFIG_DIRS" ]; then - test -f %%LOCALBASE%%/etc/xdg/compiz/compiz-manager && . %%LOCALBASE%%/etc/xdg/compiz/compiz-manager -else - test -f $XDG_CONFIG_DIRS/compiz/compiz-manager && . $XDG_CONFIG_DIRS/compiz/compiz-manager -fi - -if [ -z "$XDG_CONFIG_HOME" ]; then - test -f $HOME/.config/compiz/compiz-manager && . $HOME/.config/compiz/compiz-manager -else - test -f $XDG_CONFIG_HOME/compiz/compiz-manager && . $XDG_CONFIG_HOME/compiz/compiz-manager -fi - -# Don't use compiz when running the failsafe session -if [ "x$GNOME_DESKTOP_SESSION_ID" = "xFailsafe" ]; then - abort_with_fallback_wm -fi - -if [ "x$LIBGL_ALWAYS_INDIRECT" = "x1" ]; then - INDIRECT="yes"; -fi - -# if we run under Xgl, we can skip some tests here -if ! 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 - fi - # check if we have the required bits to run compiz and if not, - # fallback - if ! check_tfp || ! check_npot_texture || ! check_composite || ! check_texture_size; then - abort_with_fallback_wm - fi - - if check_nvidia && ! check_nvidia_memory; then - abort_with_fallback_wm - fi - - if ! check_fbconfig; then - abort_with_fallback_wm - fi -fi - -# load the ccp plugin if present and fallback to plain gconf if not -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" -fi - -# get environment -build_env -build_args - -if [ "x$CM_DRY" = "xyes" ]; then - verbose "Dry run finished: everything should work with regards to Compiz and 3D.\n" - verbose "Execute: ${COMPIZ_BIN_PATH}${COMPIZ_NAME} $COMPIZ_OPTIONS "$@" $COMPIZ_PLUGINS \n" - exit 0; -fi -# start the gtk-window-decorator if present -if [ -x ${COMPIZ_BIN_PATH}emerald ] && [ "$USE_EMERALD" = "yes" ]; then - verbose "Starting emerald\n" - ${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" - ${COMPIZ_BIN_PATH}gtk-window-decorator --replace & -elif [ -x ${COMPIZ_BIN_PATH}kde-window-decorator ] && [ -n "$KDE_FULL_SESSION" ]; then - verbose "Starting kde-window-decorator\n" - ${COMPIZ_BIN_PATH}kde-window-decorator --replace & - FALLBACKWM="${KWIN}" -fi - -${COMPIZ_BIN_PATH}${COMPIZ_NAME} $COMPIZ_OPTIONS "$@" $COMPIZ_PLUGINS || exec $FALLBACKWM $FALLBACKWM_OPTIONS - diff --git a/x11-wm/compiz/files/patch-gtk_window-decorator_gtk-window-decorator.c b/x11-wm/compiz/files/patch-gtk_window-decorator_gtk-window-decorator.c deleted file mode 100644 index 1c853c4e2..000000000 --- a/x11-wm/compiz/files/patch-gtk_window-decorator_gtk-window-decorator.c +++ /dev/null @@ -1,61 +0,0 @@ ---- gtk/window-decorator/gtk-window-decorator.c.orig 2009-08-15 09:24:40.000000000 +0200 -+++ gtk/window-decorator/gtk-window-decorator.c 2010-10-29 12:56:37.000000000 +0200 -@@ -2671,7 +2671,7 @@ get_window_prop (Window xwindow, - gdk_error_trap_push (); - - type = None; -- result = XGetWindowProperty (gdk_display, -+ result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), - xwindow, - atom, - 0, G_MAXLONG, -@@ -4233,7 +4233,7 @@ show_tooltip (const char *text) - static void - hide_tooltip (void) - { -- if (GTK_WIDGET_VISIBLE (tip_window)) -+ if (gtk_widget_get_visible (tip_window)) - g_get_current_time (&tooltip_last_popdown); - - gtk_widget_hide (tip_window); -@@ -4966,7 +4966,7 @@ force_quit_dialog_realize (GtkWidget *di - WnckWindow *win = data; - - gdk_error_trap_push (); -- XSetTransientForHint (gdk_display, -+ XSetTransientForHint (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), - GDK_WINDOW_XID (dialog->window), - wnck_window_get_xid (win)); - gdk_display_sync (gdk_display_get_default ()); -@@ -4982,11 +4982,11 @@ get_client_machine (Window xwindow) - int format, result; - char *retval; - -- atom = XInternAtom (gdk_display, "WM_CLIENT_MACHINE", FALSE); -+ atom = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "WM_CLIENT_MACHINE", FALSE); - - gdk_error_trap_push (); - -- result = XGetWindowProperty (gdk_display, -+ result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), - xwindow, atom, - 0, G_MAXLONG, - FALSE, XA_STRING, &type, &format, &nitems, -@@ -5038,7 +5038,7 @@ kill_window (WnckWindow *win) - } - - gdk_error_trap_push (); -- XKillClient (gdk_display, wnck_window_get_xid (win)); -+ XKillClient (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), wnck_window_get_xid (win)); - gdk_display_sync (gdk_display_get_default ()); - gdk_error_trap_pop (); - } -@@ -5623,7 +5623,7 @@ static int - update_shadow (void) - { - decor_shadow_options_t opt; -- Display *xdisplay = gdk_display; -+ Display *xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()); - GdkDisplay *display = gdk_display_get_default (); - GdkScreen *screen = gdk_display_get_default_screen (display); - diff --git a/x11-wm/compiz/files/patch-plugins_fuse.c b/x11-wm/compiz/files/patch-plugins_fuse.c deleted file mode 100644 index 48a0a68b9..000000000 --- a/x11-wm/compiz/files/patch-plugins_fuse.c +++ /dev/null @@ -1,11 +0,0 @@ ---- plugins/fuse.c.orig Mon Apr 2 14:15:28 2007 -+++ plugins/fuse.c Mon May 7 20:07:09 2007 -@@ -28,6 +28,8 @@ - #include <errno.h> - #include <poll.h> - #include <signal.h> -+#include <sys/types.h> -+#include <sys/param.h> - #include <sys/mount.h> - #include <fuse.h> - #include <fuse_lowlevel.h> diff --git a/x11-wm/compiz/files/patch-plugins_png.c b/x11-wm/compiz/files/patch-plugins_png.c deleted file mode 100644 index f06a746f7..000000000 --- a/x11-wm/compiz/files/patch-plugins_png.c +++ /dev/null @@ -1,29 +0,0 @@ ---- plugins/png.c.orig 2009-09-01 07:38:22.000000000 +0200 -+++ plugins/png.c 2010-04-03 22:08:10.000000000 +0200 -@@ -102,7 +102,7 @@ - - /* expand gray bit depth if needed */ - if (color_type == PNG_COLOR_TYPE_GRAY && depth < 8) -- png_set_gray_1_2_4_to_8 (png); -+ png_set_expand_gray_1_2_4_to_8 (png); - - /* transform transparency to alpha */ - if (png_get_valid(png, info, PNG_INFO_tRNS)) -@@ -167,7 +167,7 @@ - Bool status; - - sig_bytes = fread (png_sig, 1, PNG_SIG_SIZE, file); -- if (png_check_sig (png_sig, sig_bytes) == 0) -+ if (!png_sig_cmp (png_sig, 0, sig_bytes) == 0) - return FALSE; - - png = png_create_read_struct (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); -@@ -218,7 +218,7 @@ - Bool status; - - memcpy (png_sig, buffer, PNG_SIG_SIZE); -- if (png_check_sig (png_sig, PNG_SIG_SIZE) == 0) -+ if (!png_sig_cmp (png_sig, 0, PNG_SIG_SIZE) == 0) - return FALSE; - - png = png_create_read_struct (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); |