diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h index 95f3ce848..700a7ebb8 100644 --- a/include/libweston/libweston.h +++ b/include/libweston/libweston.h @@ -1460,6 +1460,7 @@ struct weston_compositor { struct wl_signal output_destroyed_signal; struct wl_signal output_moved_signal; struct wl_signal output_resized_signal; /* callback argument: resized output */ + struct wl_signal touch_device_created_signal; /* callback argument: created touch device */ /* Signal for output changes triggered by configuration from frontend * or head state changes from backend. diff --git a/libweston/compositor.c b/libweston/compositor.c index 36d09cda5..90c827c74 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -10208,6 +10208,7 @@ weston_compositor_create(struct wl_display *display, wl_signal_init(&ec->output_heads_changed_signal); wl_signal_init(&ec->session_signal); wl_signal_init(&ec->output_capture.ask_auth); + wl_signal_init(&ec->touch_device_created_signal); ec->session_active = true; ec->output_id_pool = 0; diff --git a/libweston/libinput-seat.c b/libweston/libinput-seat.c index 189b96d50..c9b5ed2ed 100644 --- a/libweston/libinput-seat.c +++ b/libweston/libinput-seat.c @@ -145,6 +145,9 @@ device_added(struct udev_input *input, struct libinput_device *libinput_device) seat->led_update(seat, seat->keyboard_state->xkb_state.leds); } + if (device->touch_device) + wl_signal_emit(&seat->compositor->touch_device_created_signal, device->touch_device); + return 0; }