[PATCH inputproto XI 2.2] Set a flag on the pointer-emulating touch event
chase.douglas at canonical.com
Mon Jan 2 18:08:10 PST 2012
On 01/02/2012 06:00 PM, Peter Hutterer wrote:
> On Mon, Jan 02, 2012 at 05:55:47PM -0800, Chase Douglas wrote:
>> On 01/02/2012 03:29 PM, Peter Hutterer wrote:
>>> Toolkits need to know which touch event emulated a pointer event and which
>>> ones do not. To quote Carlos Garnacho:
>>> GTK+ does client-side windows by default (GdkWindows without a backing X
>>> window), for this to work the toplevel window in the client needs to
>>> select for more events that it wouldn't normally select for in order to
>>> cater for the event masks in such child "windows". This means that
>>> ideally GTK+ should set the touch events mask in the toplevel, and then
>>> find out whether the "window" would receive pointer or touch events for
>>> the sequence emulating the pointer, and perform the emulation itself.
>>> Reported-by: Carlos Garnacho <carlosg at gnome.org>
>>> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
>>> IIRC we did discuss this months ago and decided not to set the flag but the
>>> above use-case cannot easily be solved right now. Adding this flag in the
>>> server is simple enough.
>>> XI2.h | 1 +
>>> specs/XI2proto.txt | 8 ++++++--
>>> 2 files changed, 7 insertions(+), 2 deletions(-)
>>> diff --git a/XI2.h b/XI2.h
>>> index 4368006..e864b06 100644
>>> --- a/XI2.h
>>> +++ b/XI2.h
>>> @@ -158,6 +158,7 @@
>>> #define XIPointerEmulated (1 << 16)
>>> /* Device event flags (touch events only) */
>>> #define XITouchPendingEnd (1 << 16)
>>> +#define XITouchEmulatingPointer (1 << 17)
>> Is this easier than having a dual-purpose XIPointerEmulated flag? We
>> would have to push XITouchPendingEnd to the 17th bit, but an ABI break
>> right now isn't too bad.
>> Or, do you have a specific reason why we shouldn't reuse the flag?
> yeah, to avoid confusion. XIPointerEmulated and XITouchEmulatingPointer have
> exactly the opposite meaning, so I'd rather have the two with different
> Plus, we get semi-namespacing this way too for the flags.
Reviewed-by: Chase Douglas <chase.douglas at canonical.com>
Let me know if you'd like me to apply and release a new version of the
proto, though I won't get to it till tomorrow.
More information about the xorg-devel