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 | 80b6384d9471e26af1a10754c6f8ddbdb926845b (patch) | |
tree | 341fd615788555e949f96755b5aa87a352386fac /XMonad | |
parent | 0b00aa082c265f1307ca9d0bfe10e2ff9b2dd79b (diff) | |
download | metatile-80b6384d9471e26af1a10754c6f8ddbdb926845b.tar metatile-80b6384d9471e26af1a10754c6f8ddbdb926845b.zip |
Fix possible head []
This seems to be a rare case, but I just got hit by it.
darcs-hash:20090106192026-23c07-28a0137e2fed8c9923e6b7c49bc9407deaaccd5e
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. |