[PATCH weston] input: add a motion signal to weston_pointer

Giulio Camuffo giuliocamuffo at gmail.com
Sun Aug 25 02:18:20 PDT 2013


The signal will be emitted after the pointer is moved. A shell plugin
can listen to the signal and activate certain effects when the pointer
touches the screen corners, for instance.
---
 src/compositor.h | 1 +
 src/input.c      | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/src/compositor.h b/src/compositor.h
index ee7853b..a2f8073 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -307,6 +307,7 @@ struct weston_pointer {
 	struct wl_listener focus_listener;
 	uint32_t focus_serial;
 	struct wl_signal focus_signal;
+	struct wl_signal motion_signal;
 
 	struct weston_surface *sprite;
 	struct wl_listener sprite_destroy_listener;
diff --git a/src/input.c b/src/input.c
index ad21be1..1aba210 100644
--- a/src/input.c
+++ b/src/input.c
@@ -315,6 +315,7 @@ weston_pointer_create(void)
 	pointer->default_grab.pointer = pointer;
 	pointer->grab = &pointer->default_grab;
 	wl_signal_init(&pointer->focus_signal);
+	wl_signal_init(&pointer->motion_signal);
 
 	pointer->sprite_destroy_listener.notify = pointer_handle_sprite_destroy;
 
@@ -630,6 +631,7 @@ notify_motion(struct weston_seat *seat,
 
 	pointer->grab->interface->focus(pointer->grab);
 	pointer->grab->interface->motion(pointer->grab, time);
+	wl_signal_emit(&pointer->motion_signal, pointer);
 }
 
 WL_EXPORT void
-- 
1.8.4



More information about the wayland-devel mailing list