tests: 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:57:46 +02:00
parent 4413b86a30
commit 873449d0f9
3 changed files with 23 additions and 18 deletions

View File

@ -152,9 +152,9 @@ stage_motion_event_cb (ClutterActor *actor,
} }
static void static void
manager_device_added_cb (ClutterDeviceManager *manager, seat_device_added_cb (ClutterSeat *seat,
ClutterInputDevice *device, ClutterInputDevice *device,
TestDevicesApp *app) TestDevicesApp *app)
{ {
ClutterInputDeviceType device_type; ClutterInputDeviceType device_type;
ClutterActor *hand = NULL; ClutterActor *hand = NULL;
@ -185,9 +185,9 @@ manager_device_added_cb (ClutterDeviceManager *manager,
} }
static void static void
manager_device_removed_cb (ClutterDeviceManager *manager, seat_device_removed_cb (ClutterSeat *seat,
ClutterInputDevice *device, ClutterInputDevice *device,
TestDevicesApp *app) TestDevicesApp *app)
{ {
ClutterInputDeviceType device_type; ClutterInputDeviceType device_type;
ClutterActor *hand = NULL; ClutterActor *hand = NULL;
@ -215,8 +215,8 @@ test_devices_main (int argc, char **argv)
{ {
ClutterActor *stage; ClutterActor *stage;
TestDevicesApp *app; TestDevicesApp *app;
ClutterDeviceManager *manager; ClutterSeat *seat;
const GSList *stage_devices, *l; GList *stage_devices, *l;
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS) if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
return 1; return 1;
@ -241,15 +241,15 @@ test_devices_main (int argc, char **argv)
clutter_actor_show_all (stage); clutter_actor_show_all (stage);
manager = clutter_device_manager_get_default (); seat = clutter_backend_get_default_seat (clutter_get_default_backend ());
g_signal_connect (manager, g_signal_connect (seat,
"device-added", G_CALLBACK (manager_device_added_cb), "device-added", G_CALLBACK (seat_device_added_cb),
app); app);
g_signal_connect (manager, g_signal_connect (seat,
"device-removed", G_CALLBACK (manager_device_removed_cb), "device-removed", G_CALLBACK (seat_device_removed_cb),
app); app);
stage_devices = clutter_device_manager_peek_devices (manager); stage_devices = clutter_seat_list_devices (seat);
if (stage_devices == NULL) if (stage_devices == NULL)
g_error ("No input devices found."); g_error ("No input devices found.");
@ -285,6 +285,8 @@ test_devices_main (int argc, char **argv)
} }
} }
g_list_free (stage_devices);
clutter_main (); clutter_main ();
return EXIT_SUCCESS; return EXIT_SUCCESS;

View File

@ -192,9 +192,9 @@ cyan_press_cb (ClutterActor *actor,
ClutterEvent *event, ClutterEvent *event,
gpointer data) gpointer data)
{ {
ClutterDeviceManager *dm = clutter_device_manager_get_default (); ClutterBackend *backend = clutter_get_default_backend ();
ClutterInputDevice *device = ClutterSeat *seat = clutter_backend_get_default_seat (backend);
clutter_device_manager_get_core_device (dm, CLUTTER_KEYBOARD_DEVICE); ClutterInputDevice *device = clutter_seat_get_pointer (seat);
if (clutter_input_device_get_grabbed_actor (device) != NULL) if (clutter_input_device_get_grabbed_actor (device) != NULL)
clutter_input_device_ungrab (device); clutter_input_device_ungrab (device);

View File

@ -95,7 +95,10 @@ static gboolean perf_fake_mouse_cb (gpointer stage)
*/ */
{ {
ClutterEvent *event2 = clutter_event_new (CLUTTER_ENTER); ClutterEvent *event2 = clutter_event_new (CLUTTER_ENTER);
device = clutter_device_manager_get_core_device (clutter_device_manager_get_default (), CLUTTER_POINTER_DEVICE); ClutterBackend *backend = clutter_get_default_backend ();
ClutterSeat *seat = clutter_backend_get_default_seat (backend);
device = clutter_seat_get_pointer (seat);
event2->crossing.stage = stage; event2->crossing.stage = stage;
event2->crossing.source = stage; event2->crossing.source = stage;