On Fri, Jan 03, 2014 at 05:41:45PM +0100, Carlos Garnacho wrote: > If a touch is currently active and emulating pointer events, XIQueryDevice > must > set the button 1 in the mask so pointer emulation is complete, as clients > using > XI2 would get inconsistent button states wrt events if querying the device. > This > is already handled correctly on the core protocol requests.
the behaviour for XIQueryPointer is to include the button state for clients < XI 2.2, but don't include it for clients that know about touch (and can thus handle touch). I think we should emulate the same behaviour here to be consistent (though I can't find the documentation for this anymore). This would of course mean that XI2.2+ clients can't tell if there's a pointer-emulating touch currently active... Cheers, Peter PS: xiquerypointer.c needs the loop below instead of a just buttonsDown > 0. Feel free to add that patch to your list ;) > Signed-off-by: Carlos Garnacho <[email protected]> > --- > Xi/xiquerydevice.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c > index 4e544f0..762968a 100644 > --- a/Xi/xiquerydevice.c > +++ b/Xi/xiquerydevice.c > @@ -261,11 +261,23 @@ ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo * info, > Bool reportState) > bits = (unsigned char *) &info[1]; > memset(bits, 0, mask_len * 4); > > - if (reportState) > + if (reportState) { > for (i = 0; i < dev->button->numButtons; i++) > if (BitIsOn(dev->button->down, i)) > SetBit(bits, i); > > + /* Cater for touch pointer-emulation */ > + if (dev->touch) { > + for (i = 0; i < dev->touch->num_touches; i++) { > + TouchPointInfoPtr ti = dev->touch->touches + i; > + if (ti->active && ti->emulate_pointer) { > + SetBit(bits, 1); > + break; > + } > + } > + } > + } > + > bits += mask_len * 4; > memcpy(bits, dev->button->labels, dev->button->numButtons * > sizeof(Atom)); > > -- > 1.8.5.2 > > _______________________________________________ > [email protected]: X.Org development > Archives: http://lists.x.org/archives/xorg-devel > Info: http://lists.x.org/mailman/listinfo/xorg-devel > _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
