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); } }
static void xdg_surface_set_app_id (struct wl_client *client, struct wl_resource *resource, const char *app_id) { MetaWaylandSurface *surface = surface_from_xdg_surface_resource (resource); meta_window_set_wm_class (surface->window, app_id, app_id); }
static void wl_shell_surface_set_class (struct wl_client *client, struct wl_resource *resource, const char *class_) { 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->wm_class, g_free); if (!g_utf8_validate (class_, -1, NULL)) class_ = ""; wl_shell_surface->wm_class = g_strdup (class_); if (surface->window) meta_window_set_wm_class (surface->window, class_, class_); }