From e7afd919c98d24798a7f9392d43d6f5a71abd586 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Wed, 2 May 2012 09:47:44 -0400 Subject: [PATCH] shell: Handle set_title and set_class --- src/shell.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/shell.c b/src/shell.c index 6b2ccbc..8c35ae8 100644 --- a/src/shell.c +++ b/src/shell.c @@ -116,6 +116,7 @@ struct shell_surface { struct desktop_shell *shell; enum shell_surface_type type, next_type; + char *title, *class; int32_t saved_x, saved_y; bool saved_position_valid; bool saved_rotation_valid; @@ -476,6 +477,26 @@ shell_surface_pong(struct wl_client *client, struct wl_resource *resource, } } +static void +shell_surface_set_title(struct wl_client *client, + struct wl_resource *resource, const char *title) +{ + struct shell_surface *shsurf = resource->data; + + free(shsurf->title); + shsurf->title = strdup(title); +} + +static void +shell_surface_set_class(struct wl_client *client, + struct wl_resource *resource, const char *class) +{ + struct shell_surface *shsurf = resource->data; + + free(shsurf->class); + shsurf->class = strdup(class); +} + static int weston_surface_move(struct weston_surface *es, struct weston_input_device *wd) @@ -1137,7 +1158,9 @@ static const struct wl_shell_surface_interface shell_surface_implementation = { shell_surface_set_transient, shell_surface_set_fullscreen, shell_surface_set_popup, - shell_surface_set_maximized + shell_surface_set_maximized, + shell_surface_set_title, + shell_surface_set_class }; static void -- 2.7.4