diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c index ef8e576e8..f55f78260 100644 --- a/src/backends/native/meta-seat-impl.c +++ b/src/backends/native/meta-seat-impl.c @@ -94,6 +94,7 @@ enum TOUCH_MODE, BELL, MODS_STATE_CHANGED, + POINTER_POSITION_CHANGED_IN_IMPL, N_SIGNALS }; @@ -932,6 +933,10 @@ meta_seat_impl_notify_relative_motion_in_impl (MetaSeatImpl *seat_impl, event->motion.dx_constrained = dx_constrained; event->motion.dy_constrained = dy_constrained; + g_signal_emit (seat_impl, signals[POINTER_POSITION_CHANGED_IN_IMPL], 0, + &GRAPHENE_POINT_INIT (seat_impl->pointer_x, + seat_impl->pointer_y)); + queue_event (seat_impl, event); } @@ -947,6 +952,10 @@ meta_seat_impl_notify_absolute_motion_in_impl (MetaSeatImpl *seat_impl, event = new_absolute_motion_event (seat_impl, input_device, time_us, x, y, axes); + g_signal_emit (seat_impl, signals[POINTER_POSITION_CHANGED_IN_IMPL], 0, + &GRAPHENE_POINT_INIT (seat_impl->pointer_x, + seat_impl->pointer_y)); + queue_event (seat_impl, event); } @@ -1590,6 +1599,10 @@ notify_absolute_motion_in_impl (ClutterInputDevice *input_device, seat_impl = seat_impl_from_device (input_device); event = new_absolute_motion_event (seat_impl, input_device, time_us, x, y, axes); + g_signal_emit (seat_impl, signals[POINTER_POSITION_CHANGED_IN_IMPL], 0, + &GRAPHENE_POINT_INIT (seat_impl->pointer_x, + seat_impl->pointer_y)); + queue_event (seat_impl, event); } @@ -3637,6 +3650,13 @@ meta_seat_impl_class_init (MetaSeatImplClass *klass) G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 0); + signals[POINTER_POSITION_CHANGED_IN_IMPL] = + g_signal_new ("pointer-position-changed-in-impl", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + 0, NULL, NULL, NULL, + G_TYPE_NONE, 1, + GRAPHENE_TYPE_POINT); g_object_class_install_properties (object_class, N_PROPS, props); }