[mutter/wip/carlosg/clutter-seat: 2/3] backends: Drop get_relative_motion_deltas() vfunc



commit 3a3f22e0ffc07d3adae681b11fc23dcfcf11d83f
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Oct 9 17:35:15 2019 +0200

    backends: Drop get_relative_motion_deltas() vfunc
    
    Just go ATM through backend checks, and looking up directly the
    native event data, pretty much like the rest of the places do that...
    Eventually would be nice to have this information in ClutterEvent,
    but let's not have it clutter the MetaBackend class.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/852

 src/backends/meta-backend-private.h       | 13 -------------
 src/backends/meta-backend.c               | 27 ---------------------------
 src/backends/native/meta-backend-native.c | 14 --------------
 src/wayland/meta-wayland-pointer.c        | 16 +++++++++++-----
 4 files changed, 11 insertions(+), 59 deletions(-)
---
diff --git a/src/backends/meta-backend-private.h b/src/backends/meta-backend-private.h
index 18261307a..cf6423f69 100644
--- a/src/backends/meta-backend-private.h
+++ b/src/backends/meta-backend-private.h
@@ -94,12 +94,6 @@ struct _MetaBackendClass
   void (* update_screen_size) (MetaBackend *backend, int width, int height);
   void (* select_stage_events) (MetaBackend *backend);
 
-  gboolean (* get_relative_motion_deltas) (MetaBackend *backend,
-                                           const        ClutterEvent *event,
-                                           double       *dx,
-                                           double       *dy,
-                                           double       *dx_unaccel,
-                                           double       *dy_unaccel);
   void (* set_numlock) (MetaBackend *backend,
                         gboolean     numlock_state);
 
@@ -154,13 +148,6 @@ void meta_backend_thaw_updates (MetaBackend *backend);
 void meta_backend_update_last_device (MetaBackend        *backend,
                                       ClutterInputDevice *device);
 
-gboolean meta_backend_get_relative_motion_deltas (MetaBackend *backend,
-                                                  const        ClutterEvent *event,
-                                                  double       *dx,
-                                                  double       *dy,
-                                                  double       *dx_unaccel,
-                                                  double       *dy_unaccel);
-
 MetaPointerConstraint * meta_backend_get_client_pointer_constraint (MetaBackend *backend);
 void meta_backend_set_client_pointer_constraint (MetaBackend *backend,
                                                  MetaPointerConstraint *constraint);
diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c
index eccb8705e..9c8c04f1c 100644
--- a/src/backends/meta-backend.c
+++ b/src/backends/meta-backend.c
@@ -589,17 +589,6 @@ meta_backend_real_select_stage_events (MetaBackend *backend)
   /* Do nothing */
 }
 
-static gboolean
-meta_backend_real_get_relative_motion_deltas (MetaBackend *backend,
-                                             const         ClutterEvent *event,
-                                             double        *dx,
-                                             double        *dy,
-                                             double        *dx_unaccel,
-                                             double        *dy_unaccel)
-{
-  return FALSE;
-}
-
 static gboolean
 meta_backend_real_is_lid_closed (MetaBackend *backend)
 {
@@ -752,7 +741,6 @@ meta_backend_class_init (MetaBackendClass *klass)
   klass->grab_device = meta_backend_real_grab_device;
   klass->ungrab_device = meta_backend_real_ungrab_device;
   klass->select_stage_events = meta_backend_real_select_stage_events;
-  klass->get_relative_motion_deltas = meta_backend_real_get_relative_motion_deltas;
   klass->is_lid_closed = meta_backend_real_is_lid_closed;
 
   signals[KEYMAP_CHANGED] =
@@ -1208,21 +1196,6 @@ meta_backend_update_last_device (MetaBackend        *backend,
     }
 }
 
-gboolean
-meta_backend_get_relative_motion_deltas (MetaBackend *backend,
-                                         const        ClutterEvent *event,
-                                         double       *dx,
-                                         double       *dy,
-                                         double       *dx_unaccel,
-                                         double       *dy_unaccel)
-{
-  MetaBackendClass *klass = META_BACKEND_GET_CLASS (backend);
-  return klass->get_relative_motion_deltas (backend,
-                                            event,
-                                            dx, dy,
-                                            dx_unaccel, dy_unaccel);
-}
-
 MetaPointerConstraint *
 meta_backend_get_client_pointer_constraint (MetaBackend *backend)
 {
diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c
index b6afb1692..97adb0a18 100644
--- a/src/backends/native/meta-backend-native.c
+++ b/src/backends/native/meta-backend-native.c
@@ -508,19 +508,6 @@ meta_backend_native_set_numlock (MetaBackend *backend,
                                          numlock_state);
 }
 
-static gboolean
-meta_backend_native_get_relative_motion_deltas (MetaBackend *backend,
-                                                const        ClutterEvent *event,
-                                                double       *dx,
-                                                double       *dy,
-                                                double       *dx_unaccel,
-                                                double       *dy_unaccel)
-{
-  return meta_event_native_get_relative_motion (event,
-                                                dx, dy,
-                                                dx_unaccel, dy_unaccel);
-}
-
 static void
 meta_backend_native_update_screen_size (MetaBackend *backend,
                                         int width, int height)
@@ -728,7 +715,6 @@ meta_backend_native_class_init (MetaBackendNativeClass *klass)
   backend_class->get_keymap = meta_backend_native_get_keymap;
   backend_class->get_keymap_layout_group = meta_backend_native_get_keymap_layout_group;
   backend_class->lock_layout_group = meta_backend_native_lock_layout_group;
-  backend_class->get_relative_motion_deltas = meta_backend_native_get_relative_motion_deltas;
   backend_class->update_screen_size = meta_backend_native_update_screen_size;
   backend_class->set_numlock = meta_backend_native_set_numlock;
 }
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index 743ff7484..159e812b9 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -291,14 +291,20 @@ meta_wayland_pointer_send_relative_motion (MetaWaylandPointer *pointer,
   uint32_t time_us_lo;
   wl_fixed_t dxf, dyf;
   wl_fixed_t dx_unaccelf, dy_unaccelf;
+  MetaBackend *backend = meta_get_backend ();
 
-  if (!pointer->focus_client)
+#ifdef HAVE_NATIVE_BACKEND
+  if (!META_IS_BACKEND_NATIVE (backend) ||
+      !meta_event_native_get_relative_motion (event,
+                                              &dx, &dy,
+                                              &dx_unaccel, &dy_unaccel))
     return;
+#else
+  if (META_IS_BACKEND_X11 (backend))
+    return;
+#endif
 
-  if (!meta_backend_get_relative_motion_deltas (meta_get_backend (),
-                                                event,
-                                                &dx, &dy,
-                                                &dx_unaccel, &dy_unaccel))
+  if (!pointer->focus_client)
     return;
 
 #ifdef HAVE_NATIVE_BACKEND


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]