Пример #1
0
static void
create_wl_shell_surface_window (MetaWaylandSurface *surface)
{
  MetaWaylandWlShellSurface *wl_shell_surface =
    META_WAYLAND_WL_SHELL_SURFACE (surface->role);
  MetaWaylandSurface *parent;
  GList *l;

  surface->window = meta_window_wayland_new (meta_get_display (), surface);
  meta_wayland_surface_set_window (surface, surface->window);

  if (wl_shell_surface->title)
    meta_window_set_title (surface->window, wl_shell_surface->title);
  if (wl_shell_surface->wm_class)
    meta_window_set_wm_class (surface->window,
                              wl_shell_surface->wm_class,
                              wl_shell_surface->wm_class);

  parent = wl_shell_surface->parent_surface;
  if (parent && parent->window)
    sync_wl_shell_parent_relationship (surface, parent);

  for (l = wl_shell_surface->children; l; l = l->next)
    {
      MetaWaylandSurface *child = l->data;

      if (child->window)
        sync_wl_shell_parent_relationship (child, surface);
    }
}
Пример #2
0
static void
xdg_surface_set_title (struct wl_client   *client,
                       struct wl_resource *resource,
                       const char         *title)
{
  MetaWaylandSurface *surface = surface_from_xdg_surface_resource (resource);

  meta_window_set_title (surface->window, title);
}
Пример #3
0
static void
wl_shell_surface_set_title (struct wl_client   *client,
                            struct wl_resource *resource,
                            const char         *title)
{
  MetaWaylandWlShellSurface *wl_shell_surface =
    META_WAYLAND_WL_SHELL_SURFACE (wl_resource_get_user_data (resource));
  MetaWaylandSurface *surface =
    surface_from_wl_shell_surface_resource (resource);

  g_clear_pointer (&wl_shell_surface->title, g_free);

  if (!g_utf8_validate (title, -1, NULL))
    title = "";

  wl_shell_surface->title = g_strdup (title);

  if (surface->window)
    meta_window_set_title (surface->window, title);
}