changeset 38890:a6653fe3cbb9

(gs-set-ghostview-colors-window-prop): Call x-change-window-property with 3rd arg FRAME. (gs-load-image): Wait for a previoius Ghostscript process to complete before starting a new one.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 21 Aug 2001 12:57:45 +0000
parents 671f0cfb3c3e
children a45d7663c469
files lisp/gs.el
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gs.el	Tue Aug 21 10:42:27 2001 +0000
+++ b/lisp/gs.el	Tue Aug 21 12:57:45 2001 +0000
@@ -138,7 +138,8 @@
 		    ((x-display-grayscale-p frame) "Grayscale")
 		    (t "Monochrome"))))
     (x-change-window-property "GHOSTVIEW_COLORS"
-			      (format "%s %s" mode pixel-colors))))
+			      (format "%s %s" mode pixel-colors)
+			      frame)))
 
 
 ;
@@ -151,7 +152,16 @@
 the form \"WINDOW-ID PIXMAP-ID\".  Value is non-nil if successful."
   (unwind-protect
       (let ((file (plist-get (cdr spec) :file))
-	    gs)
+	    gs
+	    (waiting 0))
+	;; If another ghostscript is running, wait for it to complete.
+	;; Two ghostscript processes running at the same time would
+	;; use the same window properties, and get confused.
+	(while (and (process-status "gs") (< waiting 10))
+	  (sit-for 0 100 t)
+	  (setq waiting (1+ waiting)))
+	(when (process-status "gs")
+	  (kill-process "gs"))
 	(gs-set-ghostview-window-prop frame spec img-width img-height)
 	(gs-set-ghostview-colors-window-prop frame pixel-colors)
 	(setenv "GHOSTVIEW" window-and-pixmap-id)