[Q] Xorg VNC driver?

Peter Hutterer peter.hutterer at who-t.net
Tue Sep 29 16:19:07 PDT 2009


On Wed, Sep 23, 2009 at 02:33:24PM -0500, Pat Kane wrote:
> On Wed, Sep 23, 2009 at 8:46 AM, Matthias Hopf <mhopf at suse.de> wrote:
> >
> > On Sep 23, 09 08:09:58 -0500, Pat Kane wrote:
> > > Has anyone  ported xf4vnc to xorg-server  1.7 (1.6.99....)?
> > Sorry, porting was only to 1.6.3.901 (just noted that). However, they
> > will probably a good start.
> 
> They provide a very good staring point and  have saved me a lot of
> work, thank you.
> 
> I think the the mouse init code, init.c, needs to look somthing like
> the attached snippet
>  of code (sorry I can not make patches yet).  Does that look right?
> 
> I am lookig forward to having the code in a git repo.
> 
> Pat
> ---

> ...
> 
> static int
> rfbMouseProc(pDevice, onoff)
>     DeviceIntPtr pDevice;
>     int onoff;
> {
> #define NBUTTONS 3
> #define NAXES 2
>     BYTE map[NBUTTONS + 1];
>     Atom btn_labels[NBUTTONS] = {0};
>     Atom axes_labels[NAXES] = {0};
>     DevicePtr pDev = (DevicePtr)pDevice;
> 
>     switch (onoff)
>     {
>     case DEVICE_INIT:
> 	PtrDeviceInit();
>         map[1] = 1;
>         map[2] = 2;
>         map[3] = 3;
> 
>         btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
>         btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE);
>         btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT);
> 
>         axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X);
>         axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);
> 
> 
> 	if (! InitPointerDeviceStruct(pDev, map, 
>                                       NBUTTONS, btn_labels,
>                                       (PtrCtrlProcPtr)NoopDDA, 
>                                       GetMotionHistorySize(), 
>                                       NAXES, axes_labels))
>         {
>             ErrorF("Could not initialize device '%s'. Out of memory.\n",
>                    pDev->name);
>             return BadAlloc; /* IPDS only fails on allocs */
>         }
>         pDev->valuator->axisVal[0] = screenInfo.screens[0]->width / 2;
>         pDev->last.valuators[0]    = pDev->valuator->axisVal[0];
>         pDev->valuator->axisVal[1] = screenInfo.screens[0]->height / 2;
>         pDev->last.valuators[1]    = pDev->valuator->axisVal[1];
> 
>         vncSetPointerDevice(pDevice);
> 	break;
> 
>     case DEVICE_ON:
> 
>   ...

yep, this is the standard snippet for devices that are fixed (LMR buttons
and 2 rel axes).

Cheers,
  Peter



More information about the xorg mailing list