Exemplo n.º 1
0
static void
xdg_surface_destructor (struct wl_resource *resource)
{
  MetaWaylandXdgSurface *xdg_surface = wl_resource_get_user_data (resource);
  MetaWaylandSurface *surface = surface_from_xdg_surface_resource (resource);

  meta_wayland_compositor_destroy_frame_callbacks (surface->compositor,
                                                   surface);
  meta_wayland_surface_destroy_window (surface);
  xdg_surface->resource = NULL;
}
Exemplo n.º 2
0
static void
wl_shell_surface_destructor (struct wl_resource *resource)
{
  MetaWaylandWlShellSurface *wl_shell_surface =
    META_WAYLAND_WL_SHELL_SURFACE (wl_resource_get_user_data (resource));
  MetaWaylandSurface *surface =
    surface_from_wl_shell_surface_resource (resource);
  GList *l;

  meta_wayland_compositor_destroy_frame_callbacks (surface->compositor,
                                                   surface);

  if (wl_shell_surface->popup)
    meta_wayland_popup_dismiss (wl_shell_surface->popup);

  for (l = wl_shell_surface->children; l; l = l->next)
    {
      MetaWaylandSurface *child_surface = l->data;
      MetaWaylandWlShellSurface *child_wl_shell_surface =
        META_WAYLAND_WL_SHELL_SURFACE (child_surface->role);

      child_wl_shell_surface->parent_surface = NULL;

      if (child_wl_shell_surface->parent_surface == surface)
        {
          meta_wayland_popup_dismiss (child_wl_shell_surface->popup);
          child_wl_shell_surface->parent_surface = NULL;
        }
    }

  if (wl_shell_surface->parent_surface)
    {
      MetaWaylandSurface *parent_surface = wl_shell_surface->parent_surface;
      MetaWaylandWlShellSurface *parent_wl_shell_surface =
        META_WAYLAND_WL_SHELL_SURFACE (parent_surface->role);

      parent_wl_shell_surface->children =
        g_list_remove (parent_wl_shell_surface->children, surface);
    }

  g_free (wl_shell_surface->title);
  g_free (wl_shell_surface->wm_class);

  if (wl_shell_surface->popup)
    {
      wl_shell_surface->parent_surface = NULL;

      meta_wayland_popup_dismiss (wl_shell_surface->popup);
    }

  wl_shell_surface->resource = NULL;
}
Exemplo n.º 3
0
static void
xdg_popup_destructor (struct wl_resource *resource)
{
  MetaWaylandSurface *surface = surface_from_xdg_popup_resource (resource);
  MetaWaylandXdgPopup *xdg_popup =
    META_WAYLAND_XDG_POPUP (wl_resource_get_user_data (resource));

  meta_wayland_compositor_destroy_frame_callbacks (surface->compositor,
                                                   surface);
  if (xdg_popup->parent_surface)
    {
      wl_list_remove (&xdg_popup->parent_destroy_listener.link);
      xdg_popup->parent_surface = NULL;
    }

  if (xdg_popup->popup)
    meta_wayland_popup_dismiss (xdg_popup->popup);

  xdg_popup->resource = NULL;
}