From 23ccfb3ef95efa4620498db1e5f77ae6c4c273e3 Mon Sep 17 00:00:00 2001 From: Jan Arne Petersen Date: Wed, 16 Jan 2013 21:26:54 +0100 Subject: [PATCH] shell: Do not hang after setting input_panel twice Ignore multiple calls with the same surface in input_panel_set_surface. Signed-off-by: Jan Arne Petersen --- src/shell.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/shell.c b/src/shell.c index 262ce708..1b304e18 100644 --- a/src/shell.c +++ b/src/shell.c @@ -3309,6 +3309,14 @@ input_panel_set_surface(struct wl_client *client, surface->private = shell; surface->output = output; + /* Do not do anything when surface is already in the list of + * input panel surfaces + */ + wl_list_for_each(input_panel_surface, &shell->input_panel.surfaces, link) { + if (input_panel_surface->surface == surface) + return; + } + input_panel_surface = malloc(sizeof *input_panel_surface); if (!input_panel_surface) { wl_resource_post_no_memory(resource);