aboutsummaryrefslogtreecommitdiffstats
path: root/Decoration.hs
diff options
context:
space:
mode:
authorAndrea Rossato <andrea.rossato@unibz.it>2007-08-10 20:24:33 +0200
committerAndrea Rossato <andrea.rossato@unibz.it>2007-08-10 20:24:33 +0200
commite09b645052245e8bfc1db29d80ef1d20575dc2a7 (patch)
tree83dda88b68fee96048bee9bccaca4c53b5fbbacc /Decoration.hs
parentd9535d12b2ce0dd30f14efadd286b76a2468c663 (diff)
downloadXMonadContrib-e09b645052245e8bfc1db29d80ef1d20575dc2a7.tar.gz
XMonadContrib-e09b645052245e8bfc1db29d80ef1d20575dc2a7.tar.xz
XMonadContrib-e09b645052245e8bfc1db29d80ef1d20575dc2a7.zip
Decoration: don't crash when given a non-existent font
darcs-hash:20070810182433-32816-4cd3499d70822947cbe622bf632a93a5ab2c6c72.gz
Diffstat (limited to 'Decoration.hs')
-rw-r--r--Decoration.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Decoration.hs b/Decoration.hs
index 424021c..1b971ef 100644
--- a/Decoration.hs
+++ b/Decoration.hs
@@ -66,7 +66,8 @@ withGC w fn f = withDisplay $ \d -> do gc <- io $ createGC d w
let fontname = if fn == ""
then "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*"
else fn
- font <- io $ loadQueryFont d fontname
+ font <- io $ catch (loadQueryFont d fontname)
+ (const $ loadQueryFont d "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*")
io $ setFont d gc (fontFromFontStruct font)
f d w gc font
io $ freeGC d gc