diff options
author | Andrea Rossato <andrea.rossato@unibz.it> | 2007-07-06 15:06:44 +0200 |
---|---|---|
committer | Andrea Rossato <andrea.rossato@unibz.it> | 2007-07-06 15:06:44 +0200 |
commit | a804380514ef29f5145f0cc0b368f85dc7e3b322 (patch) | |
tree | db077ccc03626ea3ba1608613d4bb9e767151062 /NamedWindows.hs | |
parent | 031a3feb87bd66d181fb118f6459d815330e3e5a (diff) | |
download | XMonadContrib-a804380514ef29f5145f0cc0b368f85dc7e3b322.tar.gz XMonadContrib-a804380514ef29f5145f0cc0b368f85dc7e3b322.tar.xz XMonadContrib-a804380514ef29f5145f0cc0b368f85dc7e3b322.zip |
NamedWindows: if fetchName returns Nothing sets the name to resName ClassHint
fetchName may return a Nothing if the window's name contains multi byte
characters. In such a case the resName string of the ClassHints of that
window will be used instead.
darcs-hash:20070706130644-32816-eb31c905767927e90b6a8010db2c50334b3e63c4.gz
Diffstat (limited to '')
-rw-r--r-- | NamedWindows.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/NamedWindows.hs b/NamedWindows.hs index d807a0c..790fe1a 100644 --- a/NamedWindows.hs +++ b/NamedWindows.hs @@ -28,7 +28,7 @@ import Control.Monad.State ( gets ) import qualified StackSet as W ( peek ) import Graphics.X11.Xlib -import Graphics.X11.Xlib.Extras ( fetchName ) +import Graphics.X11.Xlib.Extras import XMonad @@ -45,7 +45,8 @@ instance Show NamedWindow where show (NW n _) = n getName :: Window -> X NamedWindow -getName w = asks display >>= \d -> do n <- maybe "" id `fmap` io (fetchName d w) +getName w = asks display >>= \d -> do s <- io $ getClassHint d w + n <- maybe (resName s) id `fmap` io (fetchName d w) return $ NW n w unName :: NamedWindow -> Window |