wine: fix splash show during wine initialization
authorVitaly Lipatov <lav@etersoft.ru>
Sat, 19 Feb 2011 17:42:09 +0000 (20:42 +0300)
committerVitaly Lipatov <lav@etersoft.ru>
Wed, 20 Apr 2011 12:34:03 +0000 (16:34 +0400)
etersoft/scripts/wine.in

index 0c320c412c8b37247e107ca3200dc98fe18d29fb..b0ec221414c695460dcdb18b9da042462666ba7f 100644 (file)
@@ -65,41 +65,32 @@ check_display()
        [ -n "$DISPLAY" ] || fatal "Wine needs be run in X environment with DISPLAY variable"
 }
 
-check_process()
-{
-       ps xu | grep -v grep | grep "$1" >/dev/null
-}
-
 # trap signals to be able to correct exit from script
 trap signal_handler HUP PIPE INT TERM QUIT EXIT
 
-first_run()
+check_first_run()
 {
-       local SP=$1
-       # FIXME
+       tty -s && return
        check_display
-       [ -z "$SP" ] && ! check_process wineserver && init_splash gray 15 1
+       # FIXME: add real checking if needed
+       #check_process wineserver && return
+       init_splash gray 10 1
        $WINELOADER wineboot.exe --only-first
-       [ -z "$SP" ] && stop_splash
+       stop_splash
 }
 
 # run program with wine
 run_wine()
 {
+       export WINEDLLOVERRIDES="$saved_WINEDLLOVERRIDES"
        # do not check DISPLAY here, console programs can be started without DISPLAY
        if tty -s ; then
-               first_run
-               export WINEDLLOVERRIDES="$saved_WINEDLLOVERRIDES"
                exec $WINELOADER "$@"
        else
                echo "$0: Running without console, disable input" >&2
                if false && [ -z "$WINELOGFILO" ] ; then
-                       first_run splash </dev/null >$WINEPREFIX/wine.log 2>$WINEPREFIX/wine.log
-                       export WINEDLLOVERRIDES="$saved_WINEDLLOVERRIDES"
                        exec $WINELOADER "$@" </dev/null >>$WINEPREFIX/wine.log 2>>$WINEPREFIX/wine.log
                else
-                       first_run splash </dev/null
-                       export WINEDLLOVERRIDES="$saved_WINEDLLOVERRIDES"
                        exec $WINELOADER "$@" </dev/null
                fi
        fi
@@ -454,6 +445,7 @@ if [ -e "$WINEDIAG" ] ; then
                echo "It is recommended to rename (remove) old $WINEPREFIX and set new WINE environment." >&2
                fatal
        else
+               # FIXME
                # check for version consistency
                CURLINE=`head -n2 < ${WINEPREFIX}/.etersoft-release | tail -n1`
                NEWLINE=`$WINELOADER --version | head -n1`
@@ -480,6 +472,8 @@ if [ "$1" = "--removeprinters" ] ; then
        exit 0
 fi
 
+check_first_run
+
 if [ "$1" = "--workdir" ] ; then
        WINEWORKDIRPATH=$($WINELOADER winepath "$2")
        shift 2