
Untitled
By: a guest on
Jul 8th, 2012 | syntax:
C | size: 1.14 KB | hits: 16 | expires: Never
static struct window *
window_create_internal(struct display *display,
struct window *parent, int type)
{
struct window *window;
window = malloc(sizeof *window);
if (window == NULL)
return NULL;
memset(window, 0, sizeof *window);
window->display = display;
window->parent = parent;
window->surface = wl_compositor_create_surface(display->compositor);
wl_surface_add_listener(window->surface, &surface_listener, window);
if (type != TYPE_CUSTOM && display->shell) {
window->shell_surface =
wl_shell_get_shell_surface(display->shell,
window->surface);
if (window->title)
wl_shell_surface_set_title(window->shell_surface,
window->title);
}
window->allocation.x = 0;
window->allocation.y = 0;
window->allocation.width = 0;
window->allocation.height = 0;
window->saved_allocation = window->allocation;