[PATCH xserver 1/2] xwayland: Move sprite invalidation logic into mipointer
Emil Velikov
emil.l.velikov at gmail.com
Fri May 20 00:12:25 UTC 2016
On 18 May 2016 at 22:03, Keith Packard <keithp at keithp.com> wrote:
> This creates a function that invalidates the current sprite and forces
> a sprite image reload the next time the sprite is checked, moving that
> logic out of the xwayland sources and allowing the miPointerRec
> structure to be removed from the server API.
>
> Signed-off-by: Keith Packard <keithp at keithp.com>
> ---
> hw/xwayland/xwayland-input.c | 9 +--------
> mi/mipointer.c | 15 +++++++++++++++
> mi/mipointer.h | 6 ++++++
> 3 files changed, 22 insertions(+), 8 deletions(-)
>
> diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
> index cbc1bf2..d186681 100644
> --- a/hw/xwayland/xwayland-input.c
> +++ b/hw/xwayland/xwayland-input.c
> @@ -219,7 +219,6 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
> struct xwl_seat *xwl_seat = data;
> DeviceIntPtr dev = xwl_seat->pointer;
> DeviceIntPtr master;
> - miPointerPtr mipointer;
> int i;
> int sx = wl_fixed_to_int(sx_w);
> int sy = wl_fixed_to_int(sy_w);
> @@ -243,13 +242,7 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
> master = GetMaster(dev, POINTER_OR_FLOAT);
> (*pScreen->SetCursorPosition) (dev, pScreen, sx, sy, TRUE);
>
> - /* X is very likely to have the wrong idea of what the actual cursor
> - * sprite is, so in order to force updating the cursor lets set the
> - * current sprite to some invalid cursor behind its back so that it
> - * always will think it changed to the not invalid cursor.
> - */
> - mipointer = MIPOINTER(master);
> - mipointer->pSpriteCursor = (CursorPtr) 1;
> + miPointerInvalidateSprite(master);
>
> CheckMotion(NULL, master);
>
> diff --git a/mi/mipointer.c b/mi/mipointer.c
> index ada1ab5..7f95cdb 100644
> --- a/mi/mipointer.c
> +++ b/mi/mipointer.c
> @@ -468,6 +468,21 @@ miPointerUpdateSprite(DeviceIntPtr pDev)
> }
>
> /**
> + * Invalidate the current sprite and force it to be reloaded on next cursor setting
> + * operation
> + *
> + * @param pDev The device to invalidate the sprite fore
> + */
> +void
> +miPointerInvalidateSprite(DeviceIntPtr pDev)
> +{
> + miPointerPtr pPointer;
> +
> + pPointer = MIPOINTER(pDev);
> + pPointer->pSpriteCursor = (CursorPtr) 1;
> +}
> +
> +/**
> * Set the device to the coordinates on the given screen.
> *
> * @param pDev The device to move
> diff --git a/mi/mipointer.h b/mi/mipointer.h
> index bdeed12..7ce6409 100644
> --- a/mi/mipointer.h
> +++ b/mi/mipointer.h
> @@ -109,6 +109,12 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, double *x, double *y,
> extern _X_EXPORT void
> miPointerUpdateSprite(DeviceIntPtr pDev);
>
> +/* Invalidate current sprite, forcing reload on next
> + * sprite setting (window crossing, grab action, etc)
> + */
> +extern _X_EXPORT void
> +miPointerInvalidateSprite(DeviceIntPtr pDev);
> +
It doesn't look like this should be exported, should it ?
>From a quick look... many of the exported symbols seems to be left
over from when we hid (made builtin) most of the external modules
(dri/dri2/record/dbe...)
Perhaps it's worth making a list of needed symbols (ideally in an
automated manner) and throwing the remainder out there ? Then anyone
can take a small bite as they get bored ;-)
Just a related thought... there's nothing wrong with the patch.
-Emil
More information about the xorg-devel
mailing list