From a804380514ef29f5145f0cc0b368f85dc7e3b322 Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Fri, 6 Jul 2007 15:06:44 +0200 Subject: 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 --- NamedWindows.hs | 5 +++-- 1 file 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 -- cgit v1.2.3