arbtt: window titles not captured (x/kubuntu 11.10 reps / cabal 0.6.1-2 / X11-1.5.0.0)

Marcus Uneson marcus.uneson at gmail.com
Sat Jan 28 11:47:01 CET 2012


Hi again,

> An alternative would be to use Xutf8TextPropertyToTextList instead,
> which does not depend on the current locale.

hmm... oddly, the following fails in exactly the same way as before

$> diff X11-orig.hs X11.hs
0a1,2
> {-# LANGUAGE ForeignFunctionInterface #-}
>
5c7
< import Graphics.X11.Xlib.Extras
---
> import Graphics.X11.Xlib.Extras hiding (wcTextPropertyToTextList)
12a15,17
> import Foreign
> import Foreign.C
> import Foreign.C.String
20a26,27
>         loc <- supportsLocale
>         unless loc $ hPutStrLn stderr "arbtt [Warning]: locale unsupported"
82c89,92
<                               return $ if null l then "" else head l
---
>                               return $ if null l then "empty" else head l
>
>         bracket getProp (xFree . tp_value) extract `catch` \e -> return ("exception" ++ show e)
>
84c94,111
<         bracket getProp (xFree . tp_value) extract `catch` \_ -> return ""
---
> wcTextPropertyToTextList :: Display -> TextProperty -> IO [String]
> wcTextPropertyToTextList d prop =
>     alloca    $ \listp  ->
>     alloca    $ \countp ->
>     with prop $ \propp  -> do
>         throwIf (success >) (\e ->  "wcTextPropertyToTextList: " ++ show e) $
>             xutf8TextPropertyToTextList d propp listp countp
>         count <- peek countp
>         list  <- peek listp
>         texts <- flip mapM [0..fromIntegral count - 1] $ \i ->
>                      peekElemOff list i >>= peekCWString
>         wcFreeStringList list
>         return texts
>
>
> foreign import ccall unsafe "XlibExtras.h Xutf8TextPropertyToTextList"
>    xutf8TextPropertyToTextList :: Display -> Ptr TextProperty -> Ptr (Ptr CWString) -> Ptr CInt -> IO CInt
>


Locales have always been a matter of trial-and-error to me, read and written
in mysterious, poorly documented ways. In addition, it seems Ubuntu
has slightly different ideas about their configuration
than do its colleagues. To the best of my knowledge I have only used
standard gui tools for configuring the locale settings, and I don't
recall any previous
problems on this machine, but I am beginning to suspect some
misconfiguration anyway,
external to arbtt. I can get to an unused machine later today;; I will
install the same OS but
with an unmixed, vanilla locale and see if that helps.


Marcus




More information about the arbtt mailing list