kathenas / rpms / mutter

Forked from rpms/mutter 5 years ago
Clone

Blame SOURCES/0001-clutter-evdev-Use-clutter_event_set_device.patch

776610
From 580f7958efffd9548a1449c87f7f2c5e6642e6fd Mon Sep 17 00:00:00 2001
776610
From: Olivier Fourdan <ofourdan@redhat.com>
776610
Date: Mon, 19 Nov 2018 14:55:51 +0100
776610
Subject: [PATCH 01/12] clutter/evdev: Use `clutter_event_set_device()`
776610
776610
Use the relevant clutter device API `clutter_event_set_device()` instead
776610
of setting the device directly in the event field.
776610
---
776610
 clutter/clutter/evdev/clutter-device-manager-evdev.c | 3 +--
776610
 clutter/clutter/evdev/clutter-seat-evdev.c           | 4 ----
776610
 clutter/clutter/evdev/clutter-xkb-utils.c            | 2 +-
776610
 clutter/tests/performance/test-common.h              | 4 ++--
776610
 4 files changed, 4 insertions(+), 9 deletions(-)
776610
776610
diff --git a/clutter/clutter/evdev/clutter-device-manager-evdev.c b/clutter/clutter/evdev/clutter-device-manager-evdev.c
776610
index f2aeda6..a885b90 100644
776610
--- a/clutter/clutter/evdev/clutter-device-manager-evdev.c
776610
+++ b/clutter/clutter/evdev/clutter-device-manager-evdev.c
776610
@@ -324,7 +324,6 @@ new_absolute_motion_event (ClutterInputDevice *input_device,
776610
   _clutter_evdev_event_set_time_usec (event, time_us);
776610
   event->motion.time = us2ms (time_us);
776610
   event->motion.stage = stage;
776610
-  event->motion.device = seat->core_pointer;
776610
   _clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
776610
   event->motion.x = x;
776610
   event->motion.y = y;
776610
@@ -332,6 +331,7 @@ new_absolute_motion_event (ClutterInputDevice *input_device,
776610
                                                     &event->motion.x,
776610
                                                     &event->motion.y);
776610
   event->motion.axes = axes;
776610
+  clutter_event_set_device (event, seat->core_pointer);
776610
   clutter_event_set_source_device (event, input_device);
776610
 
776610
   if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
776610
@@ -519,7 +519,6 @@ notify_proximity (ClutterInputDevice *input_device,
776610
 
776610
   event->proximity.time = us2ms (time_us);
776610
   event->proximity.stage = CLUTTER_STAGE (stage);
776610
-  event->proximity.device = seat->core_pointer;
776610
   clutter_event_set_device_tool (event, device_evdev->last_tool);
776610
   clutter_event_set_device (event, seat->core_pointer);
776610
   clutter_event_set_source_device (event, input_device);
776610
diff --git a/clutter/clutter/evdev/clutter-seat-evdev.c b/clutter/clutter/evdev/clutter-seat-evdev.c
776610
index a453b11..7cba516 100644
776610
--- a/clutter/clutter/evdev/clutter-seat-evdev.c
776610
+++ b/clutter/clutter/evdev/clutter-seat-evdev.c
776610
@@ -385,7 +385,6 @@ new_absolute_motion_event (ClutterSeatEvdev   *seat,
776610
   _clutter_evdev_event_set_time_usec (event, time_us);
776610
   event->motion.time = us2ms (time_us);
776610
   event->motion.stage = stage;
776610
-  event->motion.device = seat->core_pointer;
776610
   _clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
776610
   event->motion.x = x;
776610
   event->motion.y = y;
776610
@@ -631,7 +630,6 @@ notify_scroll (ClutterInputDevice       *input_device,
776610
   _clutter_evdev_event_set_time_usec (event, time_us);
776610
   event->scroll.time = us2ms (time_us);
776610
   event->scroll.stage = CLUTTER_STAGE (stage);
776610
-  event->scroll.device = seat->core_pointer;
776610
   _clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
776610
 
776610
   /* libinput pointer axis events are in pointer motion coordinate space.
776610
@@ -684,7 +682,6 @@ notify_discrete_scroll (ClutterInputDevice     *input_device,
776610
   _clutter_evdev_event_set_time_usec (event, time_us);
776610
   event->scroll.time = us2ms (time_us);
776610
   event->scroll.stage = CLUTTER_STAGE (stage);
776610
-  event->scroll.device = seat->core_pointer;
776610
   _clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
776610
 
776610
   event->scroll.direction = direction;
776610
@@ -813,7 +810,6 @@ clutter_seat_evdev_notify_touch_event (ClutterSeatEvdev   *seat,
776610
   _clutter_evdev_event_set_time_usec (event, time_us);
776610
   event->touch.time = us2ms (time_us);
776610
   event->touch.stage = CLUTTER_STAGE (stage);
776610
-  event->touch.device = seat->core_pointer;
776610
   event->touch.x = x;
776610
   event->touch.y = y;
776610
   clutter_input_device_evdev_translate_coordinates (input_device, stage,
776610
diff --git a/clutter/clutter/evdev/clutter-xkb-utils.c b/clutter/clutter/evdev/clutter-xkb-utils.c
776610
index 7f47682..0a9a838 100644
776610
--- a/clutter/clutter/evdev/clutter-xkb-utils.c
776610
+++ b/clutter/clutter/evdev/clutter-xkb-utils.c
776610
@@ -76,12 +76,12 @@ _clutter_key_event_new_from_evdev (ClutterInputDevice *device,
776610
   else
776610
     sym = XKB_KEY_NoSymbol;
776610
 
776610
-  event->key.device = core_device;
776610
   event->key.stage = stage;
776610
   event->key.time = _time;
776610
   _clutter_xkb_translate_state (event, xkb_state, button_state);
776610
   event->key.hardware_keycode = key;
776610
   event->key.keyval = sym;
776610
+  clutter_event_set_device (event, core_device);
776610
   clutter_event_set_source_device (event, device);
776610
 
776610
   n = xkb_keysym_to_utf8 (sym, buffer, sizeof (buffer));
776610
diff --git a/clutter/tests/performance/test-common.h b/clutter/tests/performance/test-common.h
776610
index b0bed10..919fa74 100644
776610
--- a/clutter/tests/performance/test-common.h
776610
+++ b/clutter/tests/performance/test-common.h
776610
@@ -92,9 +92,9 @@ static gboolean perf_fake_mouse_cb (gpointer stage)
776610
       event2->crossing.source = stage;
776610
       event2->crossing.x = 10;
776610
       event2->crossing.y = 10;
776610
-      event2->crossing.device = device;
776610
       event2->crossing.related = NULL;
776610
 
776610
+      clutter_event_set_device (event2, device);
776610
       clutter_input_device_update_from_event (device, event2, TRUE);
776610
 
776610
       clutter_event_put (event2);
776610
@@ -104,7 +104,7 @@ static gboolean perf_fake_mouse_cb (gpointer stage)
776610
 
776610
   clutter_actor_get_size (stage, &w, &h);
776610
   event->motion.stage = stage;
776610
-  event->motion.device = device;
776610
+  clutter_event_set_device (event, device);
776610
 
776610
   /* called about every 60fps, and do 10 picks per stage */
776610
   for (i = 0; i < 10; i++)
776610
-- 
776610
2.19.2
776610