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
Fri Jan 27 22:53:52 CET 2012
>> (I skip ccing the list for this until we know more)
>
> hmm, I’d rather keep in on the list for future reference.
OK, as you wish. With this diff for src/Capture/X11.hs
$> 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
82c84
< return $ if null l then "" else head l
---
> return $ if null l then "empty" else head l
84c86,101
< 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
> arbtt-dump
TimeLogEntry {tlTime = 2012-01-27 21:39:55.733266 UTC, tlRate = 60000,
tlData = CaptureData {cWindows = [(False,"exception: user error
(wcTextPropertyToTextList: -2)","xfce4-panel"),(False,"exception: user
error (wcTextPropertyToTextList:
-2)","xfce4-panel"),(False,"exception: user error
(wcTextPropertyToTextList: -2)","xfdesktop"),(False,"exception: user
error (wcTextPropertyToTextList:
-2)","xfce4-notes"),(False,"exception: user error
(wcTextPropertyToTextList: -2)","Navigator"),(True,"exception: user
error (wcTextPropertyToTextList:
-2)","xfce4-terminal"),(False,"exception: user error
(wcTextPropertyToTextList: -2)","gedit")], cLastActivity = 41}}
I can experiment a bit further (e.g, throwIfNeg), but not tonight.
Marcus
More information about the arbtt
mailing list