Skip to content

Commit

Permalink
Fix a bug where unknown X errors crashed the WM
Browse files Browse the repository at this point in the history
  • Loading branch information
mwitmer committed Feb 22, 2014
1 parent cdd4c5f commit ce3b916
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions guile-wm
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@
(system base compile))

(define (report-error resume data)
(format (current-error-port) "X Error: ~a \n~{~a~}"
(xcb-struct-name (xcb-struct data))
(map (lambda (f) (format #f "~a: ~a\n" f (xref (xcb-data data) f)))
(xcb-struct-fields (xcb-struct data))))
(if data
(format (current-error-port) "X Error: ~a \n~{~a~}"
(xcb-struct-name (xcb-struct data))
(map (lambda (f) (format #f "~a: ~a\n"
f (xref (xcb-data data) f)))
(xcb-struct-fields (xcb-struct data))))
(format (current-error-port) "X Error: Unknown xcb-struct received"))
(resume))

(define wm-modules-spec (make-regexp "^;+\\s+wm-modules:\\s+(.+)"))
Expand Down

0 comments on commit ce3b916

Please sign in to comment.