aboutsummaryrefslogtreecommitdiff
path: root/rootston/xdg_shell.c
diff options
context:
space:
mode:
authorIlia Bozhinov <ammen99@gmail.com>2018-08-25 22:46:55 +0300
committerIlia Bozhinov <ammen99@gmail.com>2018-12-08 14:09:30 +0100
commitf387a840d89f8040fdea57a1e9e159d79fa0e7ff (patch)
treeefa492ae931cab0d89aca4b0303c5a2cddc4648d /rootston/xdg_shell.c
parent5b1b9657bfde8dd254744533c3c826aacd1f7df1 (diff)
rootston: add title/app_id/class listeners
Diffstat (limited to 'rootston/xdg_shell.c')
-rw-r--r--rootston/xdg_shell.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/rootston/xdg_shell.c b/rootston/xdg_shell.c
index d3fc5372..8d8a1479 100644
--- a/rootston/xdg_shell.c
+++ b/rootston/xdg_shell.c
@@ -265,6 +265,8 @@ static void destroy(struct roots_view *view) {
wl_list_remove(&roots_xdg_surface->request_resize.link);
wl_list_remove(&roots_xdg_surface->request_maximize.link);
wl_list_remove(&roots_xdg_surface->request_fullscreen.link);
+ wl_list_remove(&roots_xdg_surface->set_title.link);
+ wl_list_remove(&roots_xdg_surface->set_app_id.link);
roots_xdg_surface->view->xdg_surface->data = NULL;
free(roots_xdg_surface);
}
@@ -326,6 +328,18 @@ static void handle_request_fullscreen(struct wl_listener *listener,
view_set_fullscreen(view, e->fullscreen, e->output);
}
+static void handle_set_title(struct wl_listener *listener, void *data) {
+ struct roots_xdg_surface *roots_xdg_surface =
+ wl_container_of(listener, roots_xdg_surface, set_title);
+}
+
+static void handle_set_app_id(struct wl_listener *listener, void *data) {
+ struct roots_xdg_surface *roots_xdg_surface =
+ wl_container_of(listener, roots_xdg_surface, set_title);
+ wlr_log(WLR_INFO, "surface title %s",
+ roots_xdg_surface->view->xdg_surface->toplevel->title);
+}
+
static void handle_surface_commit(struct wl_listener *listener, void *data) {
struct roots_xdg_surface *roots_surface =
wl_container_of(listener, roots_surface, surface_commit);
@@ -438,6 +452,11 @@ void handle_xdg_shell_surface(struct wl_listener *listener, void *data) {
roots_surface->request_fullscreen.notify = handle_request_fullscreen;
wl_signal_add(&surface->toplevel->events.request_fullscreen,
&roots_surface->request_fullscreen);
+ roots_surface->set_title.notify = handle_set_title;
+ wl_signal_add(&surface->toplevel->events.set_title, &roots_surface->set_title);
+ roots_surface->set_app_id.notify = handle_set_app_id;
+ wl_signal_add(&surface->toplevel->events.set_app_id,
+ &roots_surface->set_app_id);
roots_surface->new_popup.notify = handle_new_popup;
wl_signal_add(&surface->events.new_popup, &roots_surface->new_popup);
surface->data = roots_surface;