[PATCH] Drop valuator mask argument from GetKeyboardEvents

Peter Hutterer peter.hutterer at who-t.net
Tue Dec 16 18:33:13 PST 2014


On Tue, Dec 16, 2014 at 08:15:31AM +0000, Daniel Stone wrote:
> Hi,
> 
> On 16 December 2014 at 04:43, Peter Hutterer <peter.hutterer at who-t.net>
> wrote:
> >
> > @@ -1157,18 +1139,6 @@ GetKeyboardEvents(InternalEvent *events,
> > DeviceIntPtr pDev, int type,
> >          set_key_up(pDev, key_code, KEY_POSTED);
> >      }
> >
> > -    clipValuators(pDev, &mask);
> > -
> > -    set_valuators(pDev, event, &mask);
> > -
> > -    if (!IsFloating(pDev)) {
> > -        DeviceIntPtr master = GetMaster(pDev, MASTER_POINTER);
> > -
> > -        event_set_root_coordinates(event,
> > -                                   master->last.valuators[0],
> > -                                   master->last.valuators[1]);
> > -    }
> > -
> >      return num_events;
> >  }
> >
> 
> Are you sure this is right? Won't this change it from returning root_[xy]
> with current MD pointer co-ordinates to nothing/rubbish?

no, this actually works, albeit mostly because of the usual mess.

ProcesDeviceEvent() updates the sprite for motion events (CheckMotion), and
then fills that position in for KeyPress events. so yes, the root coords are
garbage but since we only use those for motion events it doesn't matter.

> > diff --git a/hw/xfree86/common/xf86Module.h
> > b/hw/xfree86/common/xf86Module.h
> > index e68fe9c..25a8869 100644
> > --- a/hw/xfree86/common/xf86Module.h
> > +++ b/hw/xfree86/common/xf86Module.h
> > @@ -81,7 +81,7 @@ typedef enum {
> >   */
> >  #define ABI_ANSIC_VERSION      SET_ABI_VERSION(0, 4)
> >  #define ABI_VIDEODRV_VERSION   SET_ABI_VERSION(19, 0)
> > -#define ABI_XINPUT_VERSION     SET_ABI_VERSION(21, 0)
> > +#define ABI_XINPUT_VERSION     SET_ABI_VERSION(22, 0)
> >  #define ABI_EXTENSION_VERSION  SET_ABI_VERSION(9, 0)
> >  #define ABI_FONT_VERSION       SET_ABI_VERSION(0, 6)
> >
> > diff --git a/hw/xfree86/common/xf86Xinput.c
> > b/hw/xfree86/common/xf86Xinput.c
> > index 1fb5b16..9fa3dc4 100644
> > --- a/hw/xfree86/common/xf86Xinput.c
> > +++ b/hw/xfree86/common/xf86Xinput.c
> > @@ -1326,47 +1326,21 @@ xf86PostButtonEventM(DeviceIntPtr device,
> >  }
> >
> >  void
> > -xf86PostKeyEvent(DeviceIntPtr device,
> > -                 unsigned int key_code,
> > -                 int is_down,
> > -                 int is_absolute, int first_valuator, int num_valuators,
> > ...)
> > +xf86PostKeyEvent(DeviceIntPtr device, unsigned int key_code, int is_down)
> 
> 
> I'd probably lean towards leaving the xf86 wrappers alone (with a BUG_ON if
> you must); not sure the annoyance of an ABI break to essentially preserve
> the status quo is worth it tbh.

meh, it's a simple rebuild where needed and easy to backport. I can hold
this patch off until later in the cycle so the bisect doesn't matter as much
if you want.

Cheers,
   Peter



More information about the xorg-devel mailing list