[PATCH] dix: Add a Screen method for additional cursor confinement

Peter Hutterer peter.hutterer at who-t.net
Wed Jan 5 14:43:31 PST 2011


On Wed,  5 Jan 2011 12:05:34 -0500, Adam Jackson <ajax at redhat.com> wrote:
> This just reserves the slot in the ABI and adds the call to position
> updates.  Confining cursors to CRTCs will come soon.
 
can you add some information here as to why we need a new call and can't
just update the existing ConstrainCursor hooks?  and if we can't update
the hooks, rename it to "ConstrainCursorToCRTC", since that's what it
seems to do, guessing from the commit message.

Cheers,
  Peter


> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
>  include/scrnintstr.h |    4 ++++
>  mi/mipointer.c       |    3 +++
>  2 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/include/scrnintstr.h b/include/scrnintstr.h
> index 00d014c..2635d99 100644
> --- a/include/scrnintstr.h
> +++ b/include/scrnintstr.h
> @@ -402,6 +402,9 @@ typedef    void (* DeviceCursorCleanupProcPtr)(
>          DeviceIntPtr /* pDev */,
>          ScreenPtr    /* pScreen */);
>  
> +typedef void (*ConstrainCursorHarderProcPtr)(
> +       DeviceIntPtr, ScreenPtr, int *, int *);
> +
>  typedef struct _Screen {
>      int			myNum;	/* index of this instance in Screens[] */
>      ATOM		id;
> @@ -468,6 +471,7 @@ typedef struct _Screen {
>      /* Cursor Procedures */
>  
>      ConstrainCursorProcPtr	ConstrainCursor;
> +    ConstrainCursorHarderProcPtr ConstrainCursorHarder;
>      CursorLimitsProcPtr		CursorLimits;
>      DisplayCursorProcPtr	DisplayCursor;
>      RealizeCursorProcPtr	RealizeCursor;
> diff --git a/mi/mipointer.c b/mi/mipointer.c
> index 554397a..9bfabb7 100644
> --- a/mi/mipointer.c
> +++ b/mi/mipointer.c
> @@ -529,6 +529,9 @@ miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y)
>      if (*y >= pPointer->limits.y2)
>  	*y = pPointer->limits.y2 - 1;
>  
> +    if (pScreen->ConstrainCursorHarder)
> +       pScreen->ConstrainCursorHarder(pDev, pScreen, x, y);
> +
>      if (pPointer->x == *x && pPointer->y == *y && 
>              pPointer->pScreen == pScreen) 
>          return;
> -- 
> 1.7.3.4



More information about the xorg-devel mailing list