Commit cca51b71 authored by Carlos Garnacho's avatar Carlos Garnacho
Browse files

wayland: Create/expose pad devices

These devices are kind of an strange case. Their "master" device is
the keyboard, because they share toplevel focus with it, regardless
of stylus focus. Nonetheless, they are only expected to send the
GdkEventPad* set of events.
parent 82a46faf
......@@ -2766,6 +2766,14 @@ _gdk_wayland_seat_remove_tablet_pad (GdkWaylandSeat *seat,
GDK_WAYLAND_DEVICE_MANAGER (seat->device_manager);
seat->tablet_pads = g_list_remove (seat->tablet_pads, pad);
device_manager->devices =
g_list_remove (device_manager->devices, pad->device);
g_signal_emit_by_name (device_manager, "device-removed", pad->device);
_gdk_device_set_associated_device (pad->device, NULL);
g_object_unref (pad->device);
g_free (pad);
......@@ -4089,7 +4097,26 @@ static void
tablet_pad_handle_done (void *data,
struct zwp_tablet_pad_v2 *wp_tablet_pad)
GdkWaylandTabletPadData *pad = data;
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
GdkWaylandDeviceManager *device_manager =
GDK_WAYLAND_DEVICE_MANAGER (seat->device_manager);
g_debug (G_STRLOC ": %s pad = %p", G_STRFUNC, wp_tablet_pad);
pad->device =
"name", "Pad device",
"input-source", GDK_SOURCE_TABLET_PAD,
"input-mode", GDK_MODE_SCREEN,
"display", gdk_seat_get_display (pad->seat),
"device-manager", device_manager,
"seat", seat,
_gdk_device_set_associated_device (pad->device, seat->master_keyboard);
g_signal_emit_by_name (device_manager, "device-added", pad->device);
static void
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment