fixed x-error handling / warnings because it did return unspecific
This commit is contained in:
parent
ed62570d2e
commit
aae4511c7b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue