GraphWriter: try gv before xdg-open
authorAlp Toker <alp@nuanti.com>
Wed, 4 Jun 2014 04:11:12 +0000 (04:11 +0000)
committerAlp Toker <alp@nuanti.com>
Wed, 4 Jun 2014 04:11:12 +0000 (04:11 +0000)
Avoid changing behaviour for everyone who's used to the traditional ghostview
UI, especially since it knows how to stay in the foreground unlike xdg-open.

Amendment to r210147.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210148 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/GraphWriter.cpp

index a7bb4f26a58887a79332eb18651cdd4cd08a3b4e..306f3e89d0d7013bff37539e7ef8c98b5aa66156 100644 (file)
@@ -170,10 +170,10 @@ bool llvm::DisplayGraph(StringRef FilenameRef, bool wait,
   if (!PSViewer && S.TryFindProgram("open", ViewerPath))
     PSViewer = PSV_OSXOpen;
 #endif
-  if (!PSViewer && S.TryFindProgram("xdg-open", ViewerPath))
-    PSViewer = PSV_XDGOpen;
   if (!PSViewer && S.TryFindProgram("gv", ViewerPath))
     PSViewer = PSV_Ghostview;
+  if (!PSViewer && S.TryFindProgram("xdg-open", ViewerPath))
+    PSViewer = PSV_XDGOpen;
 
   // PostScript graph generator + PostScript viewer
   std::string GeneratorPath;