summaryrefslogtreecommitdiffstats
path: root/XMonad/ManageHook.hs
diff options
context:
space:
mode:
Diffstat (limited to 'XMonad/ManageHook.hs')
-rw-r--r--XMonad/ManageHook.hs3
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.