clutter/evdev: Use clutter_event_set_device()

Use the relevant clutter device API `clutter_event_set_device()` instead
of setting the device directly in the event field.
This commit is contained in:
Olivier Fourdan 2018-11-19 14:55:51 +01:00 committed by Ray Strode
parent eea0a2b11d
commit 9d72eeeb58
4 changed files with 4 additions and 9 deletions

View File

@ -324,7 +324,6 @@ new_absolute_motion_event (ClutterInputDevice *input_device,
_clutter_evdev_event_set_time_usec (event, time_us); _clutter_evdev_event_set_time_usec (event, time_us);
event->motion.time = us2ms (time_us); event->motion.time = us2ms (time_us);
event->motion.stage = stage; event->motion.stage = stage;
event->motion.device = seat->core_pointer;
_clutter_xkb_translate_state (event, seat->xkb, seat->button_state); _clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
event->motion.x = x; event->motion.x = x;
event->motion.y = y; event->motion.y = y;
@ -332,6 +331,7 @@ new_absolute_motion_event (ClutterInputDevice *input_device,
&event->motion.x, &event->motion.x,
&event->motion.y); &event->motion.y);
event->motion.axes = axes; event->motion.axes = axes;
clutter_event_set_device (event, seat->core_pointer);
clutter_event_set_source_device (event, input_device); clutter_event_set_source_device (event, input_device);
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE) if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
@ -519,7 +519,6 @@ notify_proximity (ClutterInputDevice *input_device,
event->proximity.time = us2ms (time_us); event->proximity.time = us2ms (time_us);
event->proximity.stage = CLUTTER_STAGE (stage); event->proximity.stage = CLUTTER_STAGE (stage);
event->proximity.device = seat->core_pointer;
clutter_event_set_device_tool (event, device_evdev->last_tool); clutter_event_set_device_tool (event, device_evdev->last_tool);
clutter_event_set_device (event, seat->core_pointer); clutter_event_set_device (event, seat->core_pointer);
clutter_event_set_source_device (event, input_device); clutter_event_set_source_device (event, input_device);

View File

@ -385,7 +385,6 @@ new_absolute_motion_event (ClutterSeatEvdev *seat,
_clutter_evdev_event_set_time_usec (event, time_us); _clutter_evdev_event_set_time_usec (event, time_us);
event->motion.time = us2ms (time_us); event->motion.time = us2ms (time_us);
event->motion.stage = stage; event->motion.stage = stage;
event->motion.device = seat->core_pointer;
_clutter_xkb_translate_state (event, seat->xkb, seat->button_state); _clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
event->motion.x = x; event->motion.x = x;
event->motion.y = y; event->motion.y = y;
@ -631,7 +630,6 @@ notify_scroll (ClutterInputDevice *input_device,
_clutter_evdev_event_set_time_usec (event, time_us); _clutter_evdev_event_set_time_usec (event, time_us);
event->scroll.time = us2ms (time_us); event->scroll.time = us2ms (time_us);
event->scroll.stage = CLUTTER_STAGE (stage); event->scroll.stage = CLUTTER_STAGE (stage);
event->scroll.device = seat->core_pointer;
_clutter_xkb_translate_state (event, seat->xkb, seat->button_state); _clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
/* libinput pointer axis events are in pointer motion coordinate space. /* libinput pointer axis events are in pointer motion coordinate space.
@ -684,7 +682,6 @@ notify_discrete_scroll (ClutterInputDevice *input_device,
_clutter_evdev_event_set_time_usec (event, time_us); _clutter_evdev_event_set_time_usec (event, time_us);
event->scroll.time = us2ms (time_us); event->scroll.time = us2ms (time_us);
event->scroll.stage = CLUTTER_STAGE (stage); event->scroll.stage = CLUTTER_STAGE (stage);
event->scroll.device = seat->core_pointer;
_clutter_xkb_translate_state (event, seat->xkb, seat->button_state); _clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
event->scroll.direction = direction; event->scroll.direction = direction;
@ -813,7 +810,6 @@ clutter_seat_evdev_notify_touch_event (ClutterSeatEvdev *seat,
_clutter_evdev_event_set_time_usec (event, time_us); _clutter_evdev_event_set_time_usec (event, time_us);
event->touch.time = us2ms (time_us); event->touch.time = us2ms (time_us);
event->touch.stage = CLUTTER_STAGE (stage); event->touch.stage = CLUTTER_STAGE (stage);
event->touch.device = seat->core_pointer;
event->touch.x = x; event->touch.x = x;
event->touch.y = y; event->touch.y = y;
clutter_input_device_evdev_translate_coordinates (input_device, stage, clutter_input_device_evdev_translate_coordinates (input_device, stage,

View File

@ -76,12 +76,12 @@ _clutter_key_event_new_from_evdev (ClutterInputDevice *device,
else else
sym = XKB_KEY_NoSymbol; sym = XKB_KEY_NoSymbol;
event->key.device = core_device;
event->key.stage = stage; event->key.stage = stage;
event->key.time = _time; event->key.time = _time;
_clutter_xkb_translate_state (event, xkb_state, button_state); _clutter_xkb_translate_state (event, xkb_state, button_state);
event->key.hardware_keycode = key; event->key.hardware_keycode = key;
event->key.keyval = sym; event->key.keyval = sym;
clutter_event_set_device (event, core_device);
clutter_event_set_source_device (event, device); clutter_event_set_source_device (event, device);
n = xkb_keysym_to_utf8 (sym, buffer, sizeof (buffer)); n = xkb_keysym_to_utf8 (sym, buffer, sizeof (buffer));

View File

@ -92,9 +92,9 @@ static gboolean perf_fake_mouse_cb (gpointer stage)
event2->crossing.source = stage; event2->crossing.source = stage;
event2->crossing.x = 10; event2->crossing.x = 10;
event2->crossing.y = 10; event2->crossing.y = 10;
event2->crossing.device = device;
event2->crossing.related = NULL; event2->crossing.related = NULL;
clutter_event_set_device (event2, device);
clutter_input_device_update_from_event (device, event2, TRUE); clutter_input_device_update_from_event (device, event2, TRUE);
clutter_event_put (event2); clutter_event_put (event2);
@ -104,7 +104,7 @@ static gboolean perf_fake_mouse_cb (gpointer stage)
clutter_actor_get_size (stage, &w, &h); clutter_actor_get_size (stage, &w, &h);
event->motion.stage = stage; event->motion.stage = stage;
event->motion.device = device; clutter_event_set_device (event, device);
/* called about every 60fps, and do 10 picks per stage */ /* called about every 60fps, and do 10 picks per stage */
for (i = 0; i < 10; i++) for (i = 0; i < 10; i++)