Merge pull request #1159 from ammen99/master

xdg-shell(-v6): add set_title and set_app_id toplevel signals
This commit is contained in:
emersion 2018-07-22 21:11:52 +01:00 committed by GitHub
commit 2297797bf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 0 deletions

View File

@ -119,6 +119,8 @@ struct wlr_xdg_toplevel {
struct wl_signal request_resize; struct wl_signal request_resize;
struct wl_signal request_show_window_menu; struct wl_signal request_show_window_menu;
struct wl_signal set_parent; struct wl_signal set_parent;
struct wl_signal set_title;
struct wl_signal set_app_id;
} events; } events;
}; };

View File

@ -127,6 +127,8 @@ struct wlr_xdg_toplevel_v6 {
struct wl_signal request_resize; struct wl_signal request_resize;
struct wl_signal request_show_window_menu; struct wl_signal request_show_window_menu;
struct wl_signal set_parent; struct wl_signal set_parent;
struct wl_signal set_title;
struct wl_signal set_app_id;
} events; } events;
}; };

View File

@ -234,6 +234,7 @@ static void xdg_toplevel_handle_set_title(struct wl_client *client,
free(surface->toplevel->title); free(surface->toplevel->title);
surface->toplevel->title = tmp; 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, 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); free(surface->toplevel->app_id);
surface->toplevel->app_id = tmp; 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, 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_resize);
wl_signal_init(&xdg_surface->toplevel->events.request_show_window_menu); 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_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->role = WLR_XDG_SURFACE_ROLE_TOPLEVEL;
xdg_surface->toplevel->base = xdg_surface; xdg_surface->toplevel->base = xdg_surface;

View File

@ -57,6 +57,7 @@ static void xdg_toplevel_handle_set_title(struct wl_client *client,
free(surface->toplevel->title); free(surface->toplevel->title);
surface->toplevel->title = tmp; 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, 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); free(surface->toplevel->app_id);
surface->toplevel->app_id = tmp; 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, 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_resize);
wl_signal_init(&xdg_surface->toplevel->events.request_show_window_menu); 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_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->role = WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL;
xdg_surface->toplevel->base = xdg_surface; xdg_surface->toplevel->base = xdg_surface;