xdg/wayland-shell: handle set_app_id and set_class events

This commit is contained in:
Johan Malm 2021-10-16 21:50:56 +01:00
parent e140682528
commit e2ae63a7cf
5 changed files with 38 additions and 6 deletions

View file

@ -93,6 +93,14 @@ handle_set_title(struct wl_listener *listener, void *data)
view_update_title(view);
}
static void
handle_set_class(struct wl_listener *listener, void *data)
{
struct view *view = wl_container_of(listener, view, set_app_id);
assert(view);
view_update_app_id(view);
}
static void
configure(struct view *view, struct wlr_box geo)
{
@ -300,8 +308,12 @@ xwayland_surface_new(struct wl_listener *listener, void *data)
view->request_fullscreen.notify = handle_request_fullscreen;
wl_signal_add(&xsurface->events.request_fullscreen,
&view->request_fullscreen);
view->set_title.notify = handle_set_title;
wl_signal_add(&xsurface->events.set_title, &view->set_title);
view->set_app_id.notify = handle_set_class;
wl_signal_add(&xsurface->events.set_class, &view->set_app_id);
wl_list_insert(&view->server->views, &view->link);
}