wayland: Check the tablet manager before creating a wp_tablet_seat

This makes things non-crashy if the compositor doesn't provide wp_tablet_manager
This commit is contained in:
Carlos Garnacho 2016-04-06 17:29:11 +02:00
parent 48239ad720
commit 6628ffd686

View File

@ -3974,11 +3974,14 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
init_devices (seat); init_devices (seat);
seat->wp_tablet_seat = if (display_wayland->tablet_manager)
zwp_tablet_manager_v1_get_tablet_seat (display_wayland->tablet_manager, {
wl_seat); seat->wp_tablet_seat =
zwp_tablet_seat_v1_add_listener (seat->wp_tablet_seat, &tablet_seat_listener, zwp_tablet_manager_v1_get_tablet_seat (display_wayland->tablet_manager,
seat); wl_seat);
zwp_tablet_seat_v1_add_listener (seat->wp_tablet_seat, &tablet_seat_listener,
seat);
}
gdk_display_add_seat (display, GDK_SEAT (seat)); gdk_display_add_seat (display, GDK_SEAT (seat));
} }