[mutter/wip/tablet-protocol: 6/15] wayland: Let MetaWaylandTabletManager process tablet events
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/tablet-protocol: 6/15] wayland: Let MetaWaylandTabletManager process tablet events
- Date: Wed, 21 Oct 2015 18:05:22 +0000 (UTC)
commit cb1c5794c2866a59992f453fee62855e66133f1f
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Jan 9 17:29:06 2015 +0100
wayland: Let MetaWaylandTabletManager process tablet events
meta_wayland_tablet_manager_update()/handle_event() are called before
the MetaWaylandSeat counterparts. If the event comes from a device
managed by MetaWaylandTabletManager, the event will be exclusively handled
by it.
src/wayland/meta-wayland-tablet.c | 1 +
src/wayland/meta-wayland.c | 9 ++++++++-
2 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/wayland/meta-wayland-tablet.c b/src/wayland/meta-wayland-tablet.c
index b990f18..7a0f317 100644
--- a/src/wayland/meta-wayland-tablet.c
+++ b/src/wayland/meta-wayland-tablet.c
@@ -94,6 +94,7 @@ meta_wayland_tablet_handle_event (MetaWaylandTablet *tablet,
{
case CLUTTER_MOTION:
handle_motion_event (tablet, event);
+ break;
case CLUTTER_BUTTON_PRESS:
case CLUTTER_BUTTON_RELEASE:
handle_button_event (tablet, event);
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index fb23f38..b05b066 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -176,7 +176,10 @@ void
meta_wayland_compositor_update (MetaWaylandCompositor *compositor,
const ClutterEvent *event)
{
- meta_wayland_seat_update (compositor->seat, event);
+ if (meta_wayland_tablet_manager_consumes_event (compositor->tablet_manager, event))
+ meta_wayland_tablet_manager_update (compositor->tablet_manager, event);
+ else
+ meta_wayland_seat_update (compositor->seat, event);
}
void
@@ -205,6 +208,10 @@ gboolean
meta_wayland_compositor_handle_event (MetaWaylandCompositor *compositor,
const ClutterEvent *event)
{
+ if (meta_wayland_tablet_manager_handle_event (compositor->tablet_manager,
+ event))
+ return TRUE;
+
return meta_wayland_seat_handle_event (compositor->seat, event);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]