Take the touch grab in MetaBackendX11

This means that it won't trigger when we're running as a Wayland
compositor, which will cause a few warnings and possibly more
brokenness.
This commit is contained in:
Jasper St. Pierre
2014-07-14 09:41:10 -04:00
parent 379bb0a77d
commit 55354f5c38
2 changed files with 20 additions and 31 deletions

View File

@ -252,6 +252,24 @@ x_event_source_new (MetaBackend *backend)
return source;
}
static void
take_touch_grab (MetaBackend *backend)
{
MetaBackendX11 *x11 = META_BACKEND_X11 (backend);
MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
XIEventMask mask = { META_VIRTUAL_CORE_POINTER_ID, sizeof (mask_bits), mask_bits };
XIGrabModifiers mods = { XIAnyModifier, 0 };
XISetMask (mask.mask, XI_TouchBegin);
XISetMask (mask.mask, XI_TouchUpdate);
XISetMask (mask.mask, XI_TouchEnd);
XIGrabTouchBegin (priv->xdisplay, META_VIRTUAL_CORE_POINTER_ID,
DefaultRootWindow (priv->xdisplay),
False, &mask, 1, &mods);
}
static void
meta_backend_x11_post_init (MetaBackend *backend)
{
@ -289,6 +307,8 @@ meta_backend_x11_post_init (MetaBackend *backend)
meta_fatal ("X server doesn't have the XInput extension, version 2.2 or newer\n");
}
take_touch_grab (backend);
META_BACKEND_CLASS (meta_backend_x11_parent_class)->post_init (backend);
}