[PATCH] shell: fix set_transient

Pekka Paalanen ppaalanen at gmail.com
Thu Dec 8 06:42:33 PST 2011


In the wl_shell_surface migration, I forgot to correct one cast in
shell_surface_set_transient(). 'parent_resource' is not a (struct
wlsc_surface *) but (struct shell_surface *).

This bug corrupts a wlsc_surface::output field, which later (in my
experiments) leads to a segmentation fault in surface_frame().

Fix the casts.

Signed-off-by: Pekka Paalanen <ppaalanen at gmail.com>
---
 compositor/shell.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/compositor/shell.c b/compositor/shell.c
index b7cfdd3..3926e52 100644
--- a/compositor/shell.c
+++ b/compositor/shell.c
@@ -315,7 +315,8 @@ shell_surface_set_transient(struct wl_client *client,
 {
 	struct shell_surface *shsurf = resource->data;
 	struct wlsc_surface *es = shsurf->surface;
-	struct wlsc_surface *pes = parent_resource->data;
+	struct shell_surface *pshsurf = parent_resource->data;
+	struct wlsc_surface *pes = pshsurf->surface;
 
 	/* assign to parents output  */
 	es->output = pes->output;
-- 
1.7.3.4



More information about the wayland-devel mailing list