clutter: Replace ClutterDeviceManager usage in favor of ClutterSeat

https://gitlab.gnome.org/GNOME/mutter/merge_requests/852
This commit is contained in:
Carlos Garnacho 2019-10-04 21:55:30 +02:00
parent f55d4f33af
commit f8fa86f9db
3 changed files with 15 additions and 20 deletions

View File

@ -452,8 +452,8 @@ clutter_input_method_forward_key (ClutterInputMethod *im,
gboolean press) gboolean press)
{ {
ClutterInputMethodPrivate *priv; ClutterInputMethodPrivate *priv;
ClutterDeviceManager *device_manager;
ClutterInputDevice *keyboard; ClutterInputDevice *keyboard;
ClutterSeat *seat;
ClutterStage *stage; ClutterStage *stage;
ClutterEvent *event; ClutterEvent *event;
@ -463,9 +463,8 @@ clutter_input_method_forward_key (ClutterInputMethod *im,
if (!priv->focus) if (!priv->focus)
return; return;
device_manager = clutter_device_manager_get_default (); seat = clutter_backend_get_default_seat (clutter_get_default_backend ());
keyboard = clutter_device_manager_get_core_device (device_manager, keyboard = clutter_seat_get_keyboard (seat);
CLUTTER_KEYBOARD_DEVICE);
stage = _clutter_input_device_get_stage (keyboard); stage = _clutter_input_device_get_stage (keyboard);
if (stage == NULL) if (stage == NULL)
return; return;

View File

@ -1834,13 +1834,10 @@ _clutter_process_event_details (ClutterActor *stage,
{ {
if (_clutter_is_input_pointer_a11y_enabled (device)) if (_clutter_is_input_pointer_a11y_enabled (device))
{ {
ClutterInputDevice *core_pointer;
gfloat x, y; gfloat x, y;
clutter_event_get_coords (event, &x, &y); clutter_event_get_coords (event, &x, &y);
core_pointer = clutter_device_manager_get_core_device (device->device_manager, _clutter_input_pointer_a11y_on_motion_event (device, x, y);
CLUTTER_POINTER_DEVICE);
_clutter_input_pointer_a11y_on_motion_event (core_pointer, x, y);
} }
} }
#endif /* CLUTTER_WINDOWING_X11 */ #endif /* CLUTTER_WINDOWING_X11 */
@ -1879,12 +1876,7 @@ _clutter_process_event_details (ClutterActor *stage,
{ {
if (_clutter_is_input_pointer_a11y_enabled (device) && (event->type != CLUTTER_MOTION)) if (_clutter_is_input_pointer_a11y_enabled (device) && (event->type != CLUTTER_MOTION))
{ {
ClutterInputDevice *core_pointer; _clutter_input_pointer_a11y_on_button_event (device,
core_pointer = clutter_device_manager_get_core_device (device->device_manager,
CLUTTER_POINTER_DEVICE);
_clutter_input_pointer_a11y_on_button_event (core_pointer,
event->button.button, event->button.button,
event->type == CLUTTER_BUTTON_PRESS); event->type == CLUTTER_BUTTON_PRESS);
} }

View File

@ -1380,20 +1380,22 @@ static GSList *
_clutter_stage_check_updated_pointers (ClutterStage *stage) _clutter_stage_check_updated_pointers (ClutterStage *stage)
{ {
ClutterStagePrivate *priv = stage->priv; ClutterStagePrivate *priv = stage->priv;
ClutterDeviceManager *device_manager; ClutterBackend *backend;
ClutterSeat *seat;
GSList *updating = NULL; GSList *updating = NULL;
const GSList *devices; GList *l, *devices;
cairo_region_t *clip; cairo_region_t *clip;
graphene_point_t point; graphene_point_t point;
clip = _clutter_stage_window_get_redraw_clip (priv->impl); clip = _clutter_stage_window_get_redraw_clip (priv->impl);
device_manager = clutter_device_manager_get_default (); backend = clutter_get_default_backend ();
devices = clutter_device_manager_peek_devices (device_manager); seat = clutter_backend_get_default_seat (backend);
devices = clutter_seat_list_devices (seat);
for (; devices != NULL; devices = devices->next) for (l = devices; l; l = l->next)
{ {
ClutterInputDevice *dev = devices->data; ClutterInputDevice *dev = l->data;
if (clutter_input_device_get_device_mode (dev) != if (clutter_input_device_get_device_mode (dev) !=
CLUTTER_INPUT_MODE_MASTER) CLUTTER_INPUT_MODE_MASTER)
@ -1422,6 +1424,8 @@ _clutter_stage_check_updated_pointers (ClutterStage *stage)
} }
} }
g_list_free (devices);
return updating; return updating;
} }