Fix fall out from shell protocol change
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>
Wed, 25 Jul 2012 10:33:06 +0000 (13:33 +0300)
committerJørgen Lind <jorgen.lind@nokia.com>
Wed, 25 Jul 2012 11:04:34 +0000 (13:04 +0200)
Compositors were crashing every time a new surface having the
transient parent set was created.

Change-Id: I3c5c0d8ca34c6739f7886281f17d1a8b0aa1c7cb
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
src/compositor/wayland_wrapper/wlshellsurface.cpp
src/compositor/wayland_wrapper/wlshellsurface.h

index a0d3e93..ee6f3e6 100644 (file)
@@ -210,7 +210,7 @@ void ShellSurface::set_toplevel(struct wl_client *client,
 
 void ShellSurface::set_transient(struct wl_client *client,
                       struct wl_resource *shell_surface_resource,
-                      struct wl_resource *parent_shell_surface_resource,
+                      struct wl_resource *parent_surface_resource,
                       int x,
                       int y,
                       uint32_t flags)
@@ -219,8 +219,8 @@ void ShellSurface::set_transient(struct wl_client *client,
     Q_UNUSED(client);
     Q_UNUSED(flags);
     ShellSurface *shell_surface = static_cast<ShellSurface *>(shell_surface_resource->data);
-    ShellSurface *parent_shell_surface = static_cast<ShellSurface *>(parent_shell_surface_resource->data);
-    shell_surface->m_transientParent = parent_shell_surface;
+    Surface *parent_surface = static_cast<Surface *>(parent_surface_resource->data);
+    shell_surface->m_transientParent = parent_surface->shellSurface();
     shell_surface->m_xOffset = x;
     shell_surface->m_yOffset = y;
     if (flags & WL_SHELL_SURFACE_TRANSIENT_INACTIVE)
index 2661afe..e8b993b 100644 (file)
@@ -111,7 +111,7 @@ private:
                              struct wl_resource *shell_surface_resource);
     static void set_transient(struct wl_client *client,
                               struct wl_resource *shell_surface_resource,
-                              struct wl_resource *parent,
+                              struct wl_resource *parent_surface_resource,
                               int x,
                               int y,
                               uint32_t flags);