mirror of
https://github.com/brl/mutter.git
synced 2025-03-25 04:33:52 +00:00
device: Motion events compression should honour the device
The motion event compression should be affected by the device field of the event; that is: we should compress motion events coming from the same device.
This commit is contained in:
parent
5ed4732737
commit
1466965773
@ -530,21 +530,36 @@ _clutter_stage_process_queued_events (ClutterStage *stage)
|
|||||||
{
|
{
|
||||||
ClutterEvent *event;
|
ClutterEvent *event;
|
||||||
ClutterEvent *next_event;
|
ClutterEvent *next_event;
|
||||||
|
ClutterInputDevice *device;
|
||||||
|
ClutterInputDevice *next_device;
|
||||||
|
gboolean check_device = FALSE;
|
||||||
|
|
||||||
event = l->data;
|
event = l->data;
|
||||||
next_event = l->next ? l->next->data : NULL;
|
next_event = l->next ? l->next->data : NULL;
|
||||||
|
|
||||||
/* Skip consecutive motion events */
|
device = clutter_event_get_device (event);
|
||||||
|
|
||||||
|
if (next_event != NULL)
|
||||||
|
next_device = clutter_event_get_device (next_event);
|
||||||
|
else
|
||||||
|
next_device = NULL;
|
||||||
|
|
||||||
|
if (device != NULL && next_device != NULL)
|
||||||
|
check_device = TRUE;
|
||||||
|
|
||||||
|
/* Skip consecutive motion events coming from the same device */
|
||||||
if (priv->throttle_motion_events &&
|
if (priv->throttle_motion_events &&
|
||||||
next_event &&
|
next_event != NULL &&
|
||||||
event->type == CLUTTER_MOTION &&
|
event->type == CLUTTER_MOTION &&
|
||||||
(next_event->type == CLUTTER_MOTION ||
|
(next_event->type == CLUTTER_MOTION ||
|
||||||
next_event->type == CLUTTER_LEAVE))
|
next_event->type == CLUTTER_LEAVE) &&
|
||||||
|
(!check_device || (device == next_device)))
|
||||||
{
|
{
|
||||||
CLUTTER_NOTE (EVENT,
|
CLUTTER_NOTE (EVENT,
|
||||||
"Omitting motion event at %.2f, %.2f",
|
"Omitting motion event at %d, %d",
|
||||||
event->motion.x, event->motion.y);
|
(int) event->motion.x,
|
||||||
goto next_event;
|
(int) event->motion.y);
|
||||||
|
goto next_event;
|
||||||
}
|
}
|
||||||
|
|
||||||
_clutter_process_event (event);
|
_clutter_process_event (event);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user