From ddb291c94fbb1d051b34d281d70151f2ee9d45ae Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Fri, 28 Dec 2007 13:59:13 +0100 Subject: textExtentsXMF doesn't require the display darcs-hash:20071228125913-32816-e6193e40cb78fed678761c550644a7c64062cb56.gz --- XMonad/Util/Font.cpphs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'XMonad/Util') diff --git a/XMonad/Util/Font.cpphs b/XMonad/Util/Font.cpphs index d3ee154..dd232f1 100644 --- a/XMonad/Util/Font.cpphs +++ b/XMonad/Util/Font.cpphs @@ -102,10 +102,10 @@ textWidthXMF dpy (Xft xftdraw) s = liftIO $ do return $ xglyphinfo_width gi #endif -textExtentsXMF :: MonadIO m => Display -> XMonadFont -> String -> m (FontDirection,Int32,Int32,CharStruct) -textExtentsXMF _ (Core fs) s = return $ textExtents fs s +textExtentsXMF :: MonadIO m => XMonadFont -> String -> m (FontDirection,Int32,Int32,CharStruct) +textExtentsXMF (Core fs) s = return $ textExtents fs s #ifdef XFT -textExtentsXMF _ (Xft xftfont) _ = liftIO $ do +textExtentsXMF (Xft xftfont) _ = liftIO $ do ascent <- xftfont_ascent xftfont descent <- xftfont_descent xftfont return (error "Font direction touched", fi ascent, fi descent, error "Font overall size touched") @@ -120,7 +120,7 @@ stringPosition :: XMonadFont -> Rectangle -> Align -> String -> X (Position,Posi stringPosition fs (Rectangle _ _ w h) al s = do dpy <- asks display width <- io $ textWidthXMF dpy fs s - (_,a,d,_) <- io $ textExtentsXMF dpy fs s + (_,a,d,_) <- io $ textExtentsXMF fs s let y = fi $ ((h - fi (a + d)) `div` 2) + fi a; x = case al of AlignCenter -> fi (w `div` 2) - fi (width `div` 2) -- cgit v1.2.3