mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 20:32:16 +00:00
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
This commit is contained in:
parent
e9fbbd5853
commit
f1d4d687f3
@ -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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -291,15 +291,21 @@ 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)
|
||||
return;
|
||||
|
||||
if (!meta_backend_get_relative_motion_deltas (meta_get_backend (),
|
||||
event,
|
||||
&dx, &dy,
|
||||
&dx_unaccel, &dy_unaccel))
|
||||
#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
|
||||
|
||||
#ifdef HAVE_NATIVE_BACKEND
|
||||
time_us = meta_event_native_get_time_usec (event);
|
||||
|
Loading…
Reference in New Issue
Block a user