mirror of
https://github.com/brl/mutter.git
synced 2024-11-11 00:26:40 -05:00
wayland-surface: Fix transient_for
It takes a wl_surface resource, not an xdg_shell_surface resource, and the argument is allowed to be NULL.
This commit is contained in:
parent
ebf6862a10
commit
a37a8c6497
@ -524,14 +524,19 @@ xdg_surface_destroy (struct wl_client *client,
|
||||
static void
|
||||
xdg_surface_set_transient_for (struct wl_client *client,
|
||||
struct wl_resource *resource,
|
||||
struct wl_resource *parent)
|
||||
struct wl_resource *parent_resource)
|
||||
{
|
||||
MetaWaylandSurfaceExtension *xdg_surface = wl_resource_get_user_data (resource);
|
||||
MetaWaylandSurface *surface = wl_container_of (xdg_surface, surface, xdg_surface);
|
||||
MetaWaylandSurfaceExtension *parent_xdg_surface = wl_resource_get_user_data (parent);
|
||||
MetaWaylandSurface *parent_surface = wl_container_of (parent_xdg_surface, surface, xdg_surface);
|
||||
MetaWindow *transient_for = NULL;
|
||||
|
||||
meta_window_set_transient_for (surface->window, parent_surface->window);
|
||||
if (parent_resource)
|
||||
{
|
||||
MetaWaylandSurface *parent_surface = wl_resource_get_user_data (parent_resource);
|
||||
transient_for = parent_surface->window;
|
||||
}
|
||||
|
||||
meta_window_set_transient_for (surface->window, transient_for);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user