[patch 2/4] Update for changes in mieq API

Peter Hutterer peter.hutterer at who-t.net
Mon Sep 29 22:10:05 PDT 2008


On Mon, Sep 29, 2008 at 11:01:43PM +0100, jon.turney at dronecode.org.uk wrote:
> @@ -221,19 +220,21 @@ winMouseWheel (ScreenPtr pScreen, int iD
>  void
>  winMouseButtonsSendEvent (int iEventType, int iButton)
>  {
> -  xEvent		xCurrentEvent;
> +  EventList *events = InitEventList(GetMaximumEventsNum());
> +  int i, nevents;



InitEventList should only be called once and that's done in the DIX anyway.
Use GetEventList() instead here.

> +  nevents = GetPointerEvents(events, inputInfo.pointer, iEventType, iButton,
> +			     POINTER_RELATIVE, 0, 0, NULL);

No, you can't do that. Calling GPE for the VCP probably won't work correctly
(at least not in all cases). You need a slave device that generates the
events, and it must be attached to the VCP.

> +/**
> + * Enqueue a motion event.
> + *
> + *  XXX: miPointerMove does exactly this, but is static :-( (and uses a static buffer)
> + *
> + */
> +void winEnqueueMotion(int x, int y)

I don't think this one is needed. use miPointerSetPosition instead.

> Index: xorg-git/xserver/hw/xwin/winmultiwindowwndproc.c
> ===================================================================
> --- xorg-git.orig/xserver/hw/xwin/winmultiwindowwndproc.c
> +++ xorg-git/xserver/hw/xwin/winmultiwindowwndproc.c
> @@ -535,9 +535,9 @@ winTopLevelWindowProc (HWND hwnd, UINT m
>  	}
>  
>        /* Deliver absolute cursor position to X Server */
> -      miPointerAbsoluteCursor (ptMouse.x - s_pScreenInfo->dwXOffset,
> -			       ptMouse.y - s_pScreenInfo->dwYOffset,
> -			       g_c32LastInputEventTime = GetTickCount ());
> +      winEnqueueMotion(ptMouse.x - s_pScreenInfo->dwXOffset, 
> +		       ptMouse.y - s_pScreenInfo->dwYOffset);
> +

as above, miPointerSetPosition.
 
Cheers,
  Peter



More information about the xorg mailing list