[PATCH xserver] Xi: Hold the input lock when sending events

Peter Hutterer peter.hutterer at who-t.net
Fri Feb 24 00:40:10 UTC 2017


On Thu, Feb 23, 2017 at 12:51:39PM -0500, Adam Jackson wrote:
> On Thu, 2017-02-23 at 09:00 +1000, Peter Hutterer wrote:
> > On Wed, Feb 22, 2017 at 10:48:24AM +0100, Olivier Fourdan wrote:
> > > 
> > > @@ -203,10 +203,12 @@ send_property_event(DeviceIntPtr dev, Atom property, int what)
> > >          .what = what
> > >      };
> > >  
> > > +    input_lock();
> > >      SendEventToAllWindows(dev, DevicePropertyNotifyMask, (xEvent *) &event, 1);
> > >  
> > >      SendEventToAllWindows(dev, GetEventFilter(dev, (xEvent *) &xi2),
> > >                            (xEvent *) &xi2, 1);
> > > +    input_unlock();
> > 
> > I don't think that's correct. The input thread is for event *generation*,
> > not processing events which is still done in the event queue. It replaces
> > the old sigio handler. 
> > 
> > I don't think anything gets here from within the input thread, does it? If
> > so, that's the bug to fix.
> 
> Called by XIChangeDeviceProperty, which at least wacom and libinput
> call from their read hook, which runs on the input thread.

wacom has a patch on the list and it turns out the libinput path for this is
currently broken anyway, so that should've never triggered.

Cheers,
   Peter



More information about the xorg-devel mailing list