diff options
author | emersion <contact@emersion.fr> | 2018-07-22 21:11:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-22 21:11:52 +0100 |
commit | 2297797bf9a6db774a3ed7909fb37f8789e1f786 (patch) | |
tree | 30adb1ea7abf35128d7f17deb9497ecbddbce9b7 | |
parent | 8935f3724d83a36534128584f865425a51c55289 (diff) | |
parent | 8b7c85d765f6ce0701a196b3948b7c4c510a356a (diff) |
Merge pull request #1159 from ammen99/master
xdg-shell(-v6): add set_title and set_app_id toplevel signals
-rw-r--r-- | include/wlr/types/wlr_xdg_shell.h | 2 | ||||
-rw-r--r-- | include/wlr/types/wlr_xdg_shell_v6.h | 2 | ||||
-rw-r--r-- | types/xdg_shell/wlr_xdg_toplevel.c | 4 | ||||
-rw-r--r-- | types/xdg_shell_v6/wlr_xdg_toplevel_v6.c | 4 |
4 files changed, 12 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_xdg_shell.h b/include/wlr/types/wlr_xdg_shell.h index 9c0e6adc..5aa6b374 100644 --- a/include/wlr/types/wlr_xdg_shell.h +++ b/include/wlr/types/wlr_xdg_shell.h @@ -119,6 +119,8 @@ struct wlr_xdg_toplevel { struct wl_signal request_resize; struct wl_signal request_show_window_menu; struct wl_signal set_parent; + struct wl_signal set_title; + struct wl_signal set_app_id; } events; }; diff --git a/include/wlr/types/wlr_xdg_shell_v6.h b/include/wlr/types/wlr_xdg_shell_v6.h index 2e1b6f11..2357d945 100644 --- a/include/wlr/types/wlr_xdg_shell_v6.h +++ b/include/wlr/types/wlr_xdg_shell_v6.h @@ -127,6 +127,8 @@ struct wlr_xdg_toplevel_v6 { struct wl_signal request_resize; struct wl_signal request_show_window_menu; struct wl_signal set_parent; + struct wl_signal set_title; + struct wl_signal set_app_id; } events; }; diff --git a/types/xdg_shell/wlr_xdg_toplevel.c b/types/xdg_shell/wlr_xdg_toplevel.c index f04aa654..0a1b9bfd 100644 --- a/types/xdg_shell/wlr_xdg_toplevel.c +++ b/types/xdg_shell/wlr_xdg_toplevel.c @@ -234,6 +234,7 @@ static void xdg_toplevel_handle_set_title(struct wl_client *client, free(surface->toplevel->title); surface->toplevel->title = tmp; + wlr_signal_emit_safe(&surface->toplevel->events.set_title, surface); } static void xdg_toplevel_handle_set_app_id(struct wl_client *client, @@ -249,6 +250,7 @@ static void xdg_toplevel_handle_set_app_id(struct wl_client *client, free(surface->toplevel->app_id); surface->toplevel->app_id = tmp; + wlr_signal_emit_safe(&surface->toplevel->events.set_app_id, surface); } static void xdg_toplevel_handle_show_window_menu(struct wl_client *client, @@ -471,6 +473,8 @@ void create_xdg_toplevel(struct wlr_xdg_surface *xdg_surface, wl_signal_init(&xdg_surface->toplevel->events.request_resize); wl_signal_init(&xdg_surface->toplevel->events.request_show_window_menu); wl_signal_init(&xdg_surface->toplevel->events.set_parent); + wl_signal_init(&xdg_surface->toplevel->events.set_title); + wl_signal_init(&xdg_surface->toplevel->events.set_app_id); xdg_surface->role = WLR_XDG_SURFACE_ROLE_TOPLEVEL; xdg_surface->toplevel->base = xdg_surface; diff --git a/types/xdg_shell_v6/wlr_xdg_toplevel_v6.c b/types/xdg_shell_v6/wlr_xdg_toplevel_v6.c index 43ca99f0..3490f337 100644 --- a/types/xdg_shell_v6/wlr_xdg_toplevel_v6.c +++ b/types/xdg_shell_v6/wlr_xdg_toplevel_v6.c @@ -57,6 +57,7 @@ static void xdg_toplevel_handle_set_title(struct wl_client *client, free(surface->toplevel->title); surface->toplevel->title = tmp; + wlr_signal_emit_safe(&surface->toplevel->events.set_title, surface); } static void xdg_toplevel_handle_set_app_id(struct wl_client *client, @@ -71,6 +72,7 @@ static void xdg_toplevel_handle_set_app_id(struct wl_client *client, free(surface->toplevel->app_id); surface->toplevel->app_id = tmp; + wlr_signal_emit_safe(&surface->toplevel->events.set_app_id, surface); } static void xdg_toplevel_handle_show_window_menu(struct wl_client *client, @@ -441,6 +443,8 @@ void create_xdg_toplevel_v6(struct wlr_xdg_surface_v6 *xdg_surface, wl_signal_init(&xdg_surface->toplevel->events.request_resize); wl_signal_init(&xdg_surface->toplevel->events.request_show_window_menu); wl_signal_init(&xdg_surface->toplevel->events.set_parent); + wl_signal_init(&xdg_surface->toplevel->events.set_title); + wl_signal_init(&xdg_surface->toplevel->events.set_app_id); xdg_surface->role = WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL; xdg_surface->toplevel->base = xdg_surface; |