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

View File

@ -192,9 +192,9 @@ cyan_press_cb (ClutterActor *actor,
ClutterEvent *event,
gpointer data)
{
ClutterDeviceManager *dm = clutter_device_manager_get_default ();
ClutterInputDevice *device =
clutter_device_manager_get_core_device (dm, CLUTTER_KEYBOARD_DEVICE);
ClutterBackend *backend = clutter_get_default_backend ();
ClutterSeat *seat = clutter_backend_get_default_seat (backend);
ClutterInputDevice *device = clutter_seat_get_pointer (seat);
if (clutter_input_device_get_grabbed_actor (device) != NULL)
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);
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.source = stage;