Guest User

Untitled

a guest
Jul 8th, 2012
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.14 KB | None | 0 0
  1. static struct window *
  2. window_create_internal(struct display *display,
  3.                        struct window *parent, int type)
  4. {
  5.         struct window *window;
  6.  
  7.         window = malloc(sizeof *window);
  8.         if (window == NULL)
  9.                 return NULL;
  10.  
  11.         memset(window, 0, sizeof *window);
  12.         window->display = display;
  13.         window->parent = parent;
  14.         window->surface = wl_compositor_create_surface(display->compositor);
  15.         wl_surface_add_listener(window->surface, &surface_listener, window);
  16.         if (type != TYPE_CUSTOM && display->shell) {
  17.                 window->shell_surface =
  18.                         wl_shell_get_shell_surface(display->shell,
  19.                                                    window->surface);
  20.                 if (window->title)
  21.                         wl_shell_surface_set_title(window->shell_surface,
  22.                                                    window->title);
  23.         }
  24.         window->allocation.x = 0;
  25.         window->allocation.y = 0;
  26.         window->allocation.width = 0;
  27.         window->allocation.height = 0;
  28.         window->saved_allocation = window->allocation;
Advertisement
Add Comment
Please, Sign In to add comment