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 00:07:59 CET 2012


(continued anyway...)

So the problem is error code -2, XLocaleNotSupported:

http://www.unix.com/man-page/All/3x/XwcTextListToTextProperty/

>XmbTextListToTextProperty()
>  will not return XLocaleNotSupported if XSupportsLocale()  has  returned
> True for the current locale.

If we including that check in the diff

$> diff X11-orig.hs X11.hs
5c5
< import Graphics.X11.Xlib.Extras
---
> import Graphics.X11.Xlib.Extras hiding (wcTextPropertyToTextList)
12a13,14
> import Foreign
> import Foreign.C.String
20a23,24
>         loc <- supportsLocale
>         unless loc $ hPutStrLn stderr "arbtt [Warning]: locale unsupported"
82c86
<                               return $ if null l then "" else head l
---
>                               return $ if null l then "empty" else head l
84c88,103
<         bracket getProp (xFree . tp_value) extract `catch` \_ -> return ""
---
>         bracket getProp (xFree . tp_value) extract `catch` \e -> return ("exception" ++ show e)
>
>
> wcTextPropertyToTextList :: Display -> TextProperty -> IO [String]
> wcTextPropertyToTextList d prop =
>     alloca    $ \listp  ->
>     alloca    $ \countp ->
>     with prop $ \propp  -> do
>         throwIf (success >) (\e ->  "wcTextPropertyToTextList: " ++ show e) $
>             xwcTextPropertyToTextList 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


then arbtt-capture does indeed complain:
arbtt [Warning]: locale unsupported

So it is clear what the error is. Does someone with more locale chops
know what to do about it?

cheers,

Marcus




More information about the arbtt mailing list