Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 8th, 2012  |  syntax: C  |  size: 1.14 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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;