diff options
author | Chase Douglas <chase.douglas@canonical.com> | 2012-04-17 10:49:14 -0700 |
---|---|---|
committer | Chase Douglas <chase.douglas@ubuntu.com> | 2012-04-18 13:58:40 -0700 |
commit | d0449851d1233543c3133d77e0ab7233319cdf5f (patch) | |
tree | d37876843ca39a5b4da31d0f6d162ffdecc6b5be /dix/touch.c | |
parent | 3d06bfe93d33cfe6150d8fb0058ee7bc8d80622b (diff) |
Create a new dix touch record for an emulated touch with no listeners
As a special case, if a still physically active pointer emulated touch
has no listeners and the device is explicitly grabbed for pointer
events, create a new dix touch record for the grab only.
This allows for clients to "hand off" grabs. For example, when dragging
a window under compiz the window decorator sees the button press and
then ungrabs the implicit grab. It then tells compiz to grab the device,
and compiz then moves the window with the pointer motion. This is racy,
but is allowed by the input protocol for pointer events when there are
no other clients with a grab on the device.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'dix/touch.c')
-rw-r--r-- | dix/touch.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/dix/touch.c b/dix/touch.c index e638a894a..572bdfb94 100644 --- a/dix/touch.c +++ b/dix/touch.c @@ -864,6 +864,11 @@ TouchSetupListeners(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev) if (dev->deviceGrab.grab) TouchAddActiveGrabListener(dev, ti, ev, dev->deviceGrab.grab); + /* We set up an active touch listener for existing touches, but not any + * passive grab or regular listeners. */ + if (ev->any.type != ET_TouchBegin) + return; + /* First, find all grabbing clients from the root window down * to the deepest child window. */ for (i = 0; i < sprite->spriteTraceGood; i++) { |