ximagesrc: Draw the cursor only when it is active in the capturing region
authorAntonio Ospite <ao2@ao2.it>
Thu, 4 Sep 2014 14:10:51 +0000 (16:10 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 16 Sep 2014 07:32:39 +0000 (10:32 +0300)
commit7554bd39168e9db89b8f856075b5cb88bbb4bc55
treecd55a3266b2c03d8109d317f76a1e295d9dabd77
parent3705f08badffd4bc4c062e9b53b4a40011501a50
ximagesrc: Draw the cursor only when it is active in the capturing region

Use XQueryPointer to check that the pointer is actually active inside
the capturing region.

This prevents drawing the cursor when the pointer is partially outside
of the captured region but not active inside the region; in particular
this avoids drawing the "window resize" cursor shapes to the captured
image when the mouse pointer crosses a window border.

NOTE that this is not only an optimization, this also happen to fix
a serious problem in multi-screen setups.

Because XFixes gives no information of what screen the pointer is on,
ximagesrc was always drawing the cursor on the captured screen even if
the mouse pointer was on another screen.

For example, when capturing from screen 1 (i.e. display-name=":0.1") the
cursor was drawn in the captured image even when the mouse pointer was
actually on screen 0, which is wrong and visually confusing.

https://bugzilla.gnome.org/show_bug.cgi?id=690646
sys/ximage/gstximagesrc.c