backends/native: Avoid meta_input_device_native_get_seat_impl()

These objects already have a pointer to the ClutterSeat that has a
pointer to the MetaSeatImpl in its native implementation. This data
may be considered pretty much immutable (a pointer to the seat is
held, and the native implementation will shut down the implementation
thread within ClutterSeat finalization.

Avoids some awkward code, since the MetaInputDeviceNative needs to
be aware of the Clutter object implementation and the implementation
object.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3278>
This commit is contained in:
Carlos Garnacho
2023-09-13 18:54:05 +02:00
parent 48c9b638f3
commit 4ce97fba6c
4 changed files with 8 additions and 14 deletions

View File

@ -158,19 +158,19 @@ static gboolean
release_device_in_impl (GTask *task)
{
ImplState *impl_state = g_task_get_task_data (task);
MetaInputDeviceNative *device_native;
ClutterSeat *seat;
MetaSeatImpl *seat_impl;
int code;
uint64_t time_us;
ClutterEvent *device_event;
device_native = META_INPUT_DEVICE_NATIVE (impl_state->device);
seat_impl = meta_input_device_native_get_seat_impl (device_native);
seat = clutter_input_device_get_seat (impl_state->device);
seat_impl = META_SEAT_NATIVE (seat)->impl;
time_us = g_get_monotonic_time ();
meta_topic (META_DEBUG_INPUT,
"Releasing pressed buttons while destroying virtual input device "
"(device %p)", device_native);
"(device %p)", impl_state->device);
for (code = 0; code < G_N_ELEMENTS (impl_state->button_count); code++)
{