Fixing effective touch point position inside the touched area
Denis Dzyubenko
shadone at gmail.com
Tue Sep 7 05:05:00 PDT 2010
Hello guys,
While looking through the drafts on the XInput2.1 specification as
published by Daniel Stone and Peter Hutterer, I've noticed one thing
that might be missing there.
Touching a screen with a finger usually produces quite a big area of
touch and the problem raises is what is the effective touch point
inside the area - as I can see it supposed to be somewhere in the top
part of the touched area - usually when a user touches the screen with
a thumb, he means to interact with an item a bit above it - however
that position depends on the screen orientation. So _someone_ is
supposed to add an offset to the area of touch that is reported to the
windowing system - otherwise it will be really hard for the user to
interact with items on the screen - for example touching the top part
of a window will be almost impossible.
This is also a problem since we want to support legacy applications
that doesn't know about touch (XInput2.1) events and only handle core
pointer events that are resulted from them.
However the driver can only specify which one of the touch sequences
should be emulated as a pointer event, but cannot specify the
effective touch position because the screen might be rotated and I
assume that the driver doesn't have that information.
The easiest solution that I can see is to add additional offsetX and
offsetY axises that the X will fill in depending on the screen
resolution and dpi and those values can be used by both X to detect
the target window in the touched area and by clients to use it as the
interaction point if required.
The only problem left is if a legacy client only handles core events
and the client is transformed - for example I know that meego doesn't
use xrandr for screen rotation (for various reasons), but instead
individual applications receive a "screen orientation change" event
and decide if the app should be rotated or not. In that case the core
pointer event will be delivered to a wrong location. But I am not sure
if we should handle that at all.
Should this problem be solved and is there any other solutions to that?
I personally do not have any experience with hacking Xorg itself, I
don't know much details about how it work, so I might be missing a lot
of points that can be obvious to you guys. Looking forward to hearing
any feedback from you.
--
Best regards,
Denis.
More information about the xorg-devel
mailing list