Retry glade(1)/glade-2(1) on DISPLAY ":0" if the Xvnc connection failed.
[macros.git] / glade-w.sh.in
index 313ebbf..d60792d 100755 (executable)
@@ -87,7 +87,17 @@ if [ "$1" != "${1#/}" ];then
      abs="$1"
 else abs="$PWD/$1"
 fi
      abs="$1"
 else abs="$PWD/$1"
 fi
-$PATH_GLADE --disable-crash-dialog -w "$abs";r=$?
+
+while true;do
+       $PATH_GLADE --disable-crash-dialog -w "$abs";r=$?
+       if [ $r -eq 0 ];then
+               break
+       fi
+       if [ "$DISPLAY" = ":0" ];then
+               break
+       fi
+       export DISPLAY=":0"
+done
 
 if test "x$xpid" != "x"
 then
 
 if test "x$xpid" != "x"
 then