Exemple #1
0
/**
 * meta_compositor_new: (skip)
 * @display:
 *
 */
MetaCompositor *
meta_compositor_new (MetaDisplay *display)
{
  MetaCompositor        *compositor;

  if (!composite_at_least_version (display, 0, 3))
    return NULL;

  compositor = g_new0 (MetaCompositor, 1);

  compositor->display = display;

  if (g_getenv("META_DISABLE_MIPMAPS"))
    compositor->no_mipmaps = TRUE;

  g_signal_connect (meta_shadow_factory_get_default (),
                    "changed",
                    G_CALLBACK (on_shadow_factory_changed),
                    compositor);

  compositor->repaint_func_id = clutter_threads_add_repaint_func (meta_repaint_func,
                                                                  compositor,
                                                                  NULL);

  return compositor;
}
Exemple #2
0
/**
 * meta_compositor_new: (skip)
 *
 */
MetaCompositor *
meta_compositor_new (MetaDisplay *display)
{
    char *atom_names[] = {
        "_XROOTPMAP_ID",
        "_XSETROOT_ID",
        "_NET_WM_WINDOW_OPACITY",
    };
    Atom                   atoms[G_N_ELEMENTS(atom_names)];
    MetaCompositor        *compositor;
    Display               *xdisplay = meta_display_get_xdisplay (display);

    if (!composite_at_least_version (display, 0, 3))
        return NULL;

    compositor = g_new0 (MetaCompositor, 1);

    compositor->display = display;

    if (g_getenv("META_DISABLE_MIPMAPS"))
        compositor->no_mipmaps = TRUE;

    meta_verbose ("Creating %d atoms\n", (int) G_N_ELEMENTS (atom_names));
    XInternAtoms (xdisplay, atom_names, G_N_ELEMENTS (atom_names),
                  False, atoms);

    g_signal_connect (meta_shadow_factory_get_default (),
                      "changed",
                      G_CALLBACK (on_shadow_factory_changed),
                      compositor);

    compositor->atom_x_root_pixmap = atoms[0];
    compositor->atom_x_set_root = atoms[1];
    compositor->atom_net_wm_window_opacity = atoms[2];

    compositor->repaint_func_id = clutter_threads_add_repaint_func (meta_repaint_func,
                                  compositor,
                                  NULL);

    return compositor;
}