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

Joachim Breitner mail at joachim-breitner.de
Fri Jan 27 21:48:29 CET 2012


Hi,

Am Freitag, den 27.01.2012, 20:37 +0100 schrieb Marcus Uneson:
> (I skip ccing the list for this until we know more)

hmm, I’d rather keep in on the list for future reference.
> 
> > Since you have recompiled arbtt yourself already, maybe you can play a
> > bit with myFetchName in src/Capture/X11.hs. For replace the two
> > occurrences of the empty string "" by something else ("dummy1",
> > "dummy2") and see which one pops up. This would narrow down the causes.
> 
> Sure. If I replace
> 
> myFetchName :: Display -> Window -> IO String
> myFetchName d w = do
>         let getProp =
>                 (internAtom d "_NET_WM_NAME" False >>= getTextProperty d w)
>                 `catch`
>                 (\_ -> getTextProperty d w wM_NAME)
> 
>             extract prop = do l <- wcTextPropertyToTextList d prop
>                               return $ if null l then "" else head l
> 
>         bracket getProp (xFree . tp_value) extract `catch` \_ -> return ""
> 
> with
> 
> myFetchName :: Display -> Window -> IO String
> myFetchName d w = do
>         let getProp =
>                 (internAtom d "_NET_WM_NAME" False >>= getTextProperty d w)
>                 `catch`
>                 (\_ -> getTextProperty d w wM_NAME)
> 
>             extract prop = do l <- wcTextPropertyToTextList d prop
>                               return $ if null l then "empty" else head l
> 
>         bracket getProp (xFree . tp_value) extract `catch` \e ->
> return ("exception: " ++ show e)
> 
> 
> I get
> 
> > arbtt-dump
> (...)
> TimeLogEntry {tlTime = 2012-01-27 19:28:28.271569 UTC, tlRate = 60000,
> tlData = CaptureData {cWindows = [(False,"exception: user error
> (wcTextPropertyToTextList)","xfce4-panel"),(False,"exception: user
> error (wcTextPropertyToTextList)","xfce4-panel"),(False,"exception:
> user error (wcTextPropertyToTextList)","xfdesktop"),(False,"exception:
> user error (wcTextPropertyToTextList)","xfce4-notes"),(False,"exception:
> user error (wcTextPropertyToTextList)","Navigator"),(True,"exception:
> user error (wcTextPropertyToTextList)","xfce4-terminal")],
> cLastActivity = 34}}
> 
> I will be happy to help if you have further ideas. I know Haskell
> reasonably well but nothing about xmonad or X11.

ok, so the problem is that XmbTextListToTextProperty returns a non-zero
value. The question is, which error is it. Unfortunately, this is not
available in the X11 bindings.

What you can do is to copy the relevant code from X11
http://hackage.haskell.org/packages/archive/X11/1.5.0.1/doc/html/src/Graphics-X11-Xlib-Extras.html#xwcTextPropertyToTextList
(wcTextPropertyToTextList and xwcTextPropertyToTextList)
and failIf from
http://hackage.haskell.org/packages/archive/base/latest/doc/html/src/Foreign-Marshal-Error.html#throwIfNeg
into the arbtt module and then modify failIf to include the error value
in the exception.

Thanks for helping out here,
Joachim

-- 
Joachim "nomeata" Breitner
  mail at joachim-breitner.de  |  nomeata at debian.org  |  GPG: 0x4743206C
  xmpp: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://lists.nomeata.de/pipermail/arbtt/attachments/20120127/327d2ba9/attachment.asc>


More information about the arbtt mailing list