[PATCH 1/2] mi: Call pScreen->ConstrainCursorHarder from the position update path

Daniel Stone daniel at fooishbar.org
Wed Jan 19 18:27:31 PST 2011


On Wed, Jan 19, 2011 at 12:58:40AM -0500, Adam Jackson wrote:
> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
>  mi/mipointer.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> diff --git a/mi/mipointer.c b/mi/mipointer.c
> index 554397a..1f08133 100644
> --- a/mi/mipointer.c
> +++ b/mi/mipointer.c
> @@ -229,6 +229,10 @@ miPointerSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen,
>      SetupScreen (pScreen);
>      GenerateEvent = generateEvent;
> +
> +    if (pScreen->ConstrainCursorHarder)
> +        pScreen->ConstrainCursorHarder(pDev, pScreen, &x, &y);
> +
>      /* device dependent - must pend signal and call miPointerWarpCursor */
>      (*pScreenPriv->screenFuncs->WarpCursor) (pDev, pScreen, x, y);
>      if (!generateEvent)

This looks good to me, except that now I think about it, we might need
CCH in _both_ miPointerSetCursorPosition, and miPointerSetPosition, or a
call to CCH in dix/getevents.c:positionSprite().  We do the right thing
in the event handling path, but without the call (direct or not) from
positionSprite(), we might send out constrained events, but have
unconstrained events recorded in the history, which is bad for any
clients still using pointer hints.

Not that anyone should be using pointer hints at all ever, but still.

Anyway, as far as I can tell, doing it both in SetCursorPosition and
SetPosition covers every possible base (WarpPointer, GetPointerEvents,
as well as making triply sure in every event handler), so with that:
Reviewed-by: Daniel Stone <daniel at fooishbar.org>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110120/6629b7ef/attachment.pgp>

More information about the xorg-devel mailing list