wayland: Fix invalid cast in transient_for

This commit is contained in:
Jasper St. Pierre 2013-11-19 12:36:12 -05:00
parent 7b85d1df50
commit 7e3e50729f

View File

@ -839,16 +839,25 @@ static void
gdk_wayland_window_sync_transient_for (GdkWindow *window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
GdkWindowImplWayland *impl_parent = GDK_WINDOW_IMPL_WAYLAND (impl->transient_for);
struct wl_surface *transient_for_surface;
if (!impl->xdg_surface)
return;
if (impl->transient_for)
{
GdkWindowImplWayland *impl_parent = GDK_WINDOW_IMPL_WAYLAND (impl->transient_for->impl);
/* XXX: Is this correct? */
if (!impl_parent->surface)
return;
xdg_surface_set_transient_for (impl->xdg_surface, impl_parent->surface);
transient_for_surface = impl_parent->surface;
}
else
transient_for_surface = NULL;
xdg_surface_set_transient_for (impl->xdg_surface, transient_for_surface);
}
static void