summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrea Rossato <andrea.rossato@ing.unitn.it>2007-07-24 19:30:47 +0200
committerAndrea Rossato <andrea.rossato@ing.unitn.it>2007-07-24 19:30:47 +0200
commit68104c657b29d605fd6ac05962badceb1bec801e (patch)
treee7e65c303d72bec76925408bc481e739be6cc8ab
parent96e1563c37087d506a4842c1a5f96488ee7aa049 (diff)
downloadxmobar-68104c657b29d605fd6ac05962badceb1bec801e.tar.gz
xmobar-68104c657b29d605fd6ac05962badceb1bec801e.tar.bz2
loadQueryFont must be protected by catch
Expecially now that fonts can be easily choose with a command line options. darcs-hash:20070724173047-d6583-30c6a0a1315216cb21e3132c64448e01bd846de2.gz
-rw-r--r--Xmobar.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Xmobar.hs b/Xmobar.hs
index 7142a8d..7e67647 100644
--- a/Xmobar.hs
+++ b/Xmobar.hs
@@ -140,7 +140,8 @@ drawInWin str =
bgcolor <- io $ initColor dpy $ bgColor config
gc <- io $ createGC dpy win
--let's get the fonts
- fontst <- io $ loadQueryFont dpy (font config)
+ let lf c = loadQueryFont dpy (font c)
+ fontst <- io $ catch (lf config) (const $ lf defaultConfig)
io $ setFont dpy gc (fontFromFontStruct fontst)
-- create a pixmap to write to and fill it with a rectangle
p <- io $ createPixmap dpy win