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



commit 4f2bcd8f7057535e7660e975b005fb64e5fd8001
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 132646068..10858e041 100644
--- a/src/backends/meta-backend-private.h
+++ b/src/backends/meta-backend-private.h
@@ -106,12 +106,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);
 
@@ -170,13 +164,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 2d1519787..9d133c5d4 100644
--- a/src/backends/meta-backend.c
+++ b/src/backends/meta-backend.c
@@ -588,17 +588,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)
 {
@@ -751,7 +740,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] =
@@ -1221,21 +1209,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 8d827e7d7..bd441626b 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)
@@ -725,7 +712,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 73d45e4a4..aa92d4240 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]