Xfwm4 compositor zooming patch

Alistair Buxton a.j.buxton at gmail.com
Sat Nov 16 17:56:30 CET 2013


I've made a new branch with some fixes:
https://github.com/ali1234/xfwm4/commits/zoom2

I think this still needs more testing before being merged, as the one
person who reported it doesn't work got a completely black screen
which is a pretty bad regression.

On 16 November 2013 10:49, Nick Schermer <nick at xfce.org> wrote:
> Nice patch.
>
> Small note about the code, please avoid "//" comments.

Fixed. Also brace style fixed to match the rest of the code.

> Another note is the timeout, I understand why you do this but the 32ms feels
> a bit random (1000/60*2 is a better way to indicate you run it half the fps
> for example). That said XQueryPointer is not the fastest function on this
> planet so cpu usage becomes "high" why a user starts to zoom why not moving
> the mouse. Maybe it is possible to use the mousemotion event for that, but
> this is probably limited because you need to grab the pointer for the full
> list of events. Duno if there are other options for this?

Polling XQueryPointer is what compiz does. I realise compiz isn't
known for being the best code in the world, but in this case the only
alternative seems to be grabbing the mouse and doing input
redirection, which is quite complex and has some problems. For some
general background see:
http://bazaar.launchpad.net/~compiz-team/compiz/0.9.11/view/head:/plugins/ezoom/src/ezoom.cpp#L37
http://bazaar.launchpad.net/~compiz-team/compiz/0.9.11/view/head:/plugins/mousepoll/src/mousepoll.cpp#L27

Xfwm4 compositor already gets the refresh rate of the display using
randr. It is probably better to use that where available, rather than
a hardcoded value.

If anyone has any better ideas...

> The change to the clipping seems correct since paint_win only works on the
> rootBuffer. That said the function also applies its own clipping before
> rendering so it might be redundant as well.

Yes, paint_win sets the clipping region in every case when it is
called from the first loop (because it also modifies it), so I guess
the call is completely unnecessary.

> Nick
>
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev at xfce.org
> https://mail.xfce.org/mailman/listinfo/xfce4-dev



-- 
Alistair Buxton
a.j.buxton at gmail.com


More information about the Xfce4-dev mailing list