From b7d880c5a784fe0429996e290de7d6903608a298 Mon Sep 17 00:00:00 2001 From: Lukas Mai Date: Sun, 6 Apr 2008 03:31:23 +0200 Subject: XMonad.Util.Font: don't call setlocale; core does it for us darcs-hash:20080406013123-462cf-886315685e0e1a8824b384d05d1e89b557047cde.gz --- XMonad/Util/Font.hsc | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'XMonad/Util/Font.hsc') diff --git a/XMonad/Util/Font.hsc b/XMonad/Util/Font.hsc index 5be594d..be6b59e 100644 --- a/XMonad/Util/Font.hsc +++ b/XMonad/Util/Font.hsc @@ -45,7 +45,6 @@ import Graphics.X11.Xrender #if defined XFT || defined UTF8 import Codec.Binary.UTF8.String (encodeString, decodeString) -import Foreign.C #endif -- Hide the Core Font/Xft switching here @@ -99,14 +98,13 @@ initXMF :: String -> X XMonadFont initXMF s = #ifdef XFT if xftPrefix `isPrefixOf` s then - do io setupLocale - dpy <- asks display + do dpy <- asks display xftdraw <- io $ xftFontOpen dpy (defaultScreenOfDisplay dpy) (drop (length xftPrefix) s) return (Xft xftdraw) else #endif #ifdef UTF8 - (io setupLocale >> initUtf8Font s >>= (return . Utf8)) + (initUtf8Font s >>= (return . Utf8)) #else (initCoreFont s >>= (return . Core)) #endif @@ -213,14 +211,3 @@ encodeOutput = id -- | Short-hand for 'fromIntegral' fi :: (Integral a, Num b) => a -> b fi = fromIntegral - -#if defined XFT || defined UTF8 -#include -foreign import ccall unsafe "locale.h setlocale" - setlocale :: CInt -> CString -> IO CString - -setupLocale :: IO () -setupLocale = withCString "" $ \s -> do - setlocale (#const LC_ALL) s - return () -#endif -- cgit v1.2.3