gnome-session: where to put "--disable-acceleration-check"

Building on DomQ's answer above, try this for /etc/X11/Xsession.d/98-gnome-session-disable-acceleration-check

case "$STARTUP" in
     *gnome-session*)
       STARTUP="$STARTUP --disable-acceleration-check"
       ;;
     *x-session-manager*)
       if $(/usr/bin/update-alternatives --query x-session-manager|grep -q "^Value:.*gnome-session")
       then
         STARTUP="$STARTUP --disable-acceleration-check"
       fi
       ;;
esac

Edit: it looks like update-alternatives is located in /usr/bin instead of /usr/sbin in recent versions of Ubuntu. I've updated the above script to match the new location. If you're not sure where update-alternatives is on your system, try running "which update-alternatives" in a terminal window.