[PATCH 17/18] shell: Do not hang after setting input_panel twice
Jan Arne Petersen
jpetersen at openismus.com
Wed Jan 16 12:26:54 PST 2013
From: Jan Arne Petersen <jpetersen at openismus.com>
Ignore multiple calls with the same surface in input_panel_set_surface.
Signed-off-by: Jan Arne Petersen <jpetersen at openismus.com>
---
src/shell.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/shell.c b/src/shell.c
index 0f25663..898d228 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -3272,6 +3272,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);
--
1.8.1
More information about the wayland-devel
mailing list