]> granicus.if.org Git - graphviz/commitdiff
partial fix for #1175 untagged-46da481a5543e7a1bf8e
authorJohn Ellson <john.ellson@comcast.net>
Thu, 1 Dec 2016 03:08:08 +0000 (22:08 -0500)
committerJohn Ellson <john.ellson@comcast.net>
Thu, 1 Dec 2016 03:08:08 +0000 (22:08 -0500)
plugin/xlib/gvdevice_xlib.c
plugin/xlib/slow_graph_stream_test.sh [new file with mode: 0755]
plugin/xlib/vimdot.sh

index c9bd292ee545734745b1ba3fbc312924a97311e9..a7883fe091ec181ef50a290399dde71e7a90c0e3 100644 (file)
@@ -573,8 +573,10 @@ static void xlib_finalize(GVJ_t *firstjob)
        if (watching_stdin_p) {
            if (FD_ISSET(stdin_fd, &rfds)) {
                 ret = handle_stdin_events(firstjob, stdin_fd);
-               if (ret < 0)
+               if (ret < 0) {
                    watching_stdin_p = FALSE;
+                    FD_CLR(stdin_fd, &rfds);
+                }
                events += ret;
            }
            if (watching_stdin_p) 
diff --git a/plugin/xlib/slow_graph_stream_test.sh b/plugin/xlib/slow_graph_stream_test.sh
new file mode 100755 (executable)
index 0000000..cd6b38e
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# intended to test the behavior of 'dot -Tx11' to a succession of graphs on stdin
+# with an interval in between, which should be enough to allow each graph to be seen
+
+# usage:   ./slow_graph_stream_test.sh | dot -Tx11
+
+while true; do
+    echo "digraph {rankdir=RL; 0->{1 2}}"
+    sleep 2
+    echo "digraph {rankdir=LR; 0->{1 2}}"
+    sleep 2
+done
index cd40fccbc25d3923e7d8eaa77c14ffc61469993e..a8d25b5b21eb4bfb8f42d557ea1d9d1a5c834c71 100755 (executable)
@@ -38,7 +38,6 @@ fi
 if ! test -w "$f"; then error "$f is not writable"; fi
 
 # dot -Txlib watches the file $f for changes using inotify()
-# run it in an xterm window to handle any stderr
-xterm -e dot -Txlib "$f" 2>/dev/null &
+dot -Txlib "$f" 2>/dev/null &
 # open an editor on the file $f (could be any editor; gvim &'s itself)
 exec $editor "$f"