magnus
magnus copied to clipboard
Allow window to follow cursor as well as mouse pointer
Possibly tangentially related to PR #15, I was reading a comment from someone who relied on the Compiz magnifier as it was the only one which followed the cursor of typed text as well as following the mouse pointer. Is this something which could be implemented in magnus?
I like the concept, but I have no idea at all how to do it. I don't know of any API that lets you interrogate an app to see where its cursor is, and indeed I don't think such an API can exist -- I've certainly never implemented it in any app I've ever built with a cursor, and if it's done at widget set level you'd still have to cope with multiple widget sets. I don't know how compiz could possibly know this; do you know how it did it? I'm certainly happy to look at allowing magnus to do this if it's not too difficult.
Digging deeper, i think this is in the Enhanced Zoom plugin rather than the Magnifier plugin. Also, it doesn't look like simple code and I'm not quite sure of the magic they are using. I can't even get my head around the preamble at https://git.launchpad.net/compiz/tree/plugins/ezoom/src/ezoom.cpp to begin to understand this. Happy for this to be closed if it isn't feasible.
Having looked around a bit, I have learned the following:
- Orca seems to have some sort of way to track where the text caret is (implied by https://mail.gnome.org/archives/gnome-accessibility-devel/2007-August/msg00014.html)
- ezoom was inspired by inputzoom, a plugin for beryl (remember beryl from before compiz?) and used many of the same techniques
- ezoom apparently did not use AT-SPI, which is what I assume Orca is using
- I am utterly unable to find any indication of how ezoom or inputzoom worked out where the text caret was in order to follow its position
...none of which is an answer, but it might give you some indication of further places to look, if you didn't know all of this stuff already!