magnus icon indicating copy to clipboard operation
magnus copied to clipboard

Allow window to follow cursor as well as mouse pointer

Open mcphail opened this issue 4 years ago • 3 comments

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?

mcphail avatar Feb 03 '21 11:02 mcphail

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.

stuartlangridge avatar Feb 03 '21 13:02 stuartlangridge

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.

mcphail avatar Feb 06 '21 23:02 mcphail

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!

stuartlangridge avatar Feb 06 '21 23:02 stuartlangridge