fixed x-error handling / warnings because it did return unspecific

This commit is contained in:
frese 2003-05-04 17:35:02 +00:00
parent ed62570d2e
commit aae4511c7b
1 changed files with 11 additions and 13 deletions

View File

@ -29,24 +29,22 @@
(if (not (eq? queue (display:error-queue display)))
(let* ((next (next-x-error-queue queue))
(error (x-error-queue:this next)))
(signal-x-warning error))
result))))
(signal-x-warning error)))
result)))
(thunk))
(error "first argument of an xlib-function must be a display object"
name display)))
(define (call-critical thunk)
(let ((old-enabled (set-enabled-interrupts! no-interrupts))
(result (call-with-current-continuation
(lambda (return)
(cons #t
(with-handler (lambda (condition punt)
(return (cons #f condition)))
thunk))))))
(set-enabled-interrupts! old-enabled)
(if (car result)
(cdr result)
(signal-condition (cdr result)))))
(let ((old-enabled (set-enabled-interrupts! no-interrupts)))
(with-handler
(lambda (condition punt)
(set-enabled-interrupts! old-enabled)
(punt))
(lambda ()
(let ((result (thunk)))
(set-enabled-interrupts! old-enabled)
result)))))
;; TODO: pixmap-formats (XListPixmapFormats)
(define-record-type display :display