XFixes - the problem and the dirty workaround
Summer of code is over, and by and large, things are working. I’ve gotten some text-caret stuff working through python, but on the POC level, and this would be the only missing part of my project, which I personally believe have exceeded the original goal in other areas. We WILL have text-caret tracking.
But, this post is about XFixes.
With Ezoom, there is an option to hide the original mouse pointer, and this is done through XFixes, and it triggers a bugged behavior. Basically, animated cursors will be reported as having width==height==1, and they’ll be invisible. What is worse, they will even be invisible after you unhide the cursor.
However, you need this for some of the best tricks ezoom can pull off. I consider the bug worth it in my daily use, because I use default cursors, so the only animated cursor I have, is the Firefox “page loading” one.
I recently applied a tiny patch that somewhat helps, it’s so simple, you can probably understand it with zero C knowledge, this is inside the “zoomUpdateCursor” function which is called when XFixes tells us a cursor change occurred, and we try to fetch the new one:
+ if (ci->width height
This means that if the new cursor has a width and height equal to or less than 1, we ignore it. Simple ass that. The result is that, when you are zoomed in and the cursor would otherwise go invisible, you won't see a change at all. It's a bit awkward, it's an ugly workaround, but it's so simple and I figure that it's better to have this than have no cursor at all.
The animated cursors will still be invisible when ezoom is NOT zoomed in, however, because X draws the pointer, not compiz, when we're not zoomed in.
I am interested in any feedback on the result of this hack, drawbacks you experience, success stories, anything.
[...] There is, however, a solution to this and that is to use the currently inactive compiz-cursor drawing code. It’s already in compiz — if you check out the source and have a look at cursor.c, you’ll see what I mean. The only problem with the code in it’s current state IMO is that is relies on XFixesHideCursor, a function which is particularly bug-ridden as noted by Kristian Lyngstol. [...]
Pingback by SmSpillaz’ Blog — October 7, 2008 @ 2:35 pm
[...] two functions in Xfixes extension to hide and display the main pointer. But as pointed out by Kristian Lyngstøl this feature has a problem again the pointer became visible. Indeed all animated pointers [...]
Pingback by Cairo Composite Manager » Blog Archive » Magnifier and XFixes [Hide/Show] Cursor patch — March 23, 2009 @ 12:31 am