diff options
author | Joachim Breitner <mail@joachim-breitner.de> | 2009-01-06 20:20:26 +0100 |
---|---|---|
committer | Joachim Breitner <mail@joachim-breitner.de> | 2009-01-06 20:20:26 +0100 |
commit | f61783a79a0e515119456754e89b370bac06d57d (patch) | |
tree | 341fd615788555e949f96755b5aa87a352386fac /XMonad | |
parent | d41c9c31eaab2ffd39bead72204903eff5922fb7 (diff) | |
download | xmonad-f61783a79a0e515119456754e89b370bac06d57d.tar.gz xmonad-f61783a79a0e515119456754e89b370bac06d57d.tar.xz xmonad-f61783a79a0e515119456754e89b370bac06d57d.zip |
Fix possible head []
This seems to be a rare case, but I just got hit by it.
darcs-hash:20090106192026-23c07-28a0137e2fed8c9923e6b7c49bc9407deaaccd5e.gz
Diffstat (limited to 'XMonad')
-rw-r--r-- | XMonad/ManageHook.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/XMonad/ManageHook.hs b/XMonad/ManageHook.hs index a0b7bb4..ac528c1 100644 --- a/XMonad/ManageHook.hs +++ b/XMonad/ManageHook.hs @@ -71,7 +71,8 @@ title = ask >>= \w -> liftX $ do getProp = (internAtom d "_NET_WM_NAME" False >>= getTextProperty d w) `catch` \_ -> getTextProperty d w wM_NAME - extract = fmap head . wcTextPropertyToTextList d + extract prop = do l <- wcTextPropertyToTextList d prop + return $ if null l then "" else head l io $ bracket getProp (xFree . tp_value) extract `catch` \_ -> return "" -- | Return the application name. |