seat/impl: Add signal for pointer motions
This signal is emitted directly in the input thread. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2777>
This commit is contained in:
parent
f4b76727db
commit
ef64279035
1 changed files with 20 additions and 0 deletions
|
@ -94,6 +94,7 @@ enum
|
||||||
TOUCH_MODE,
|
TOUCH_MODE,
|
||||||
BELL,
|
BELL,
|
||||||
MODS_STATE_CHANGED,
|
MODS_STATE_CHANGED,
|
||||||
|
POINTER_POSITION_CHANGED_IN_IMPL,
|
||||||
N_SIGNALS
|
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.dx_constrained = dx_constrained;
|
||||||
event->motion.dy_constrained = dy_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);
|
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);
|
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);
|
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);
|
seat_impl = seat_impl_from_device (input_device);
|
||||||
event = new_absolute_motion_event (seat_impl, input_device, time_us, x, y, axes);
|
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);
|
queue_event (seat_impl, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3637,6 +3650,13 @@ meta_seat_impl_class_init (MetaSeatImplClass *klass)
|
||||||
G_SIGNAL_RUN_LAST,
|
G_SIGNAL_RUN_LAST,
|
||||||
0, NULL, NULL, NULL,
|
0, NULL, NULL, NULL,
|
||||||
G_TYPE_NONE, 0);
|
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);
|
g_object_class_install_properties (object_class, N_PROPS, props);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue