[PATCH kdrive/ephyr v2] kdrive/ephyr: map host X server's keymap into Xephyr, if supported

Laércio de Sousa laerciosousa at sme-mogidascruzes.sp.gov.br
Thu Feb 25 19:32:50 UTC 2016


2016-02-25 16:07 GMT-03:00 Adam Jackson <ajax at nwnk.net>:

> @ -1291,16 +1290,35 @@ KdPointerDriver EphyrMouseDriver = {
> >  static Status
> >  EphyrKeyboardInit(KdKeyboardInfo * ki)
> >  {
> > +    int i;
>
> Unused variable.
>

Removed. Thanks!

> +    if (!keySyms.minKeyCode) {
> >          ErrorF("Couldn't load keymap from host\n");
> >          return BadAlloc;
> >      }
>
> I don't think this can ever be triggered? hostx_load_keymap initializes
> minKeyCode based on the initial connection block before doing anything
> else, and it'll never be 0 because the X protocol guarantees it's >= 8.
>
> I suppose that's not your fault, the current code is broken in the same
> way. Still probably best to just delete that conditional, if we ever
> run against a non-XKB server we might as well try to stumble through.
>

I'll drop it. Thanks!


> > diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
> > index 3a1c6a0..00ef4d0 100644
> > --- a/hw/kdrive/src/kinput.c
> > +++ b/hw/kdrive/src/kinput.c
> > @@ -747,10 +747,6 @@ KdKeyboardProc(DeviceIntPtr pDevice, int onoff)
> >              return BadImplementation;
> >          }
> >
> > -        if ((*ki->driver->Init) (ki) != Success) {
> > -            return !Success;
> > -        }
> > -
> >          memset(&rmlvo, 0, sizeof(rmlvo));
> >          rmlvo.rules = ki->xkbRules;
> >          rmlvo.model = ki->xkbModel;
> > @@ -763,6 +759,10 @@ KdKeyboardProc(DeviceIntPtr pDevice, int onoff)
> >              return BadImplementation;
> >          }
> >
> > +        if ((*ki->driver->Init) (ki) != Success) {
> > +            return !Success;
> > +        }
> > +
> >          xiclass = AtomFromName(XI_KEYBOARD);
> >          AssignTypeAndName(pDevice, xiclass,
> >                            ki->name ? ki->name : "Generic KDrive
> Keyboard");
>
> This seems like it clobbers whatever you'd have passed in from the
> command line (in patch 2/4 of your other series). Am I reading that
> right? What's the desired result here


The thing here is that I want to call XkbApplyMappingChange() +
XkbDDXChangeControls() inside EphyrKeyboardInit(), so I can isolate this
code properly (I don't need it for e.g. kdrive evdev driver, since this one
takes keymap directly from proposed -xkb-* options or udev properties), but
I can only do that if EphyrKeyboardInit() is called *after*
InitKeyboardDeviceStruct(). This is why I've moved the "if
((*ki->driver->Init) (ki) != Success) ..." block down a bit.

-- 
*Laércio de Sousa*
*Orientador de Informática*
*Escola Municipal "Professor Eulálio Gruppi"*
*Rua Ismael da Silva Mello, 559, Mogi Moderno*
*Mogi das Cruzes - SPCEP 08717-390*
Telefone: (11) 4726-8313
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.x.org/archives/xorg-devel/attachments/20160225/0428fa06/attachment.html>


More information about the xorg-devel mailing list