aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2007-05-26 20:51:14 +0200
committerDavid Roundy <droundy@darcs.net>2007-05-26 20:51:14 +0200
commitd6c76f192898086e0e08eb26ef9c2a869f4fa80a (patch)
tree7624cd8cb7e821b16aebe128255ad50ca4027015
parent8e0cafeeba94abaa45a9868931d8a7c547bfa406 (diff)
downloadXMonadContrib-d6c76f192898086e0e08eb26ef9c2a869f4fa80a.tar.gz
XMonadContrib-d6c76f192898086e0e08eb26ef9c2a869f4fa80a.tar.xz
XMonadContrib-d6c76f192898086e0e08eb26ef9c2a869f4fa80a.zip
replace "name" in NamedWindow with a Show instance.
darcs-hash:20070526185114-72aca-9d4f72347c0e065bbceb180b87b52564b5bb9767.gz
-rw-r--r--NamedWindows.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/NamedWindows.hs b/NamedWindows.hs
index 307c407..c2aa910 100644
--- a/NamedWindows.hs
+++ b/NamedWindows.hs
@@ -1,4 +1,4 @@
-module XMonadContrib.NamedWindows ( NamedWindow, getName, withNamedWindow, unName, name ) where
+module XMonadContrib.NamedWindows ( NamedWindow, getName, withNamedWindow, unName ) where
-- This module allows you to associate the X titles of windows with
-- them. See XMonadContrib.Mosaic for an example of its use.
@@ -18,6 +18,8 @@ instance Eq NamedWindow where
(NW s _) == (NW s' _) = s == s'
instance Ord NamedWindow where
compare (NW s _) (NW s' _) = compare s s'
+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)
@@ -26,9 +28,6 @@ getName w = asks display >>= \d -> do n <- maybe "" id `fmap` io (fetchName d w)
unName :: NamedWindow -> Window
unName (NW _ w) = w
-name :: NamedWindow -> String
-name (NW n _) = n
-
withNamedWindow :: (NamedWindow -> X ()) -> X ()
withNamedWindow f = do ws <- gets windowset
whenJust (W.peek ws) $ \w -> getName w >>= f