Merge branch 'master' into my-overlay-design

This commit is contained in:
Marina Zhurakhinskaya 2009-06-11 18:24:42 -04:00
commit 6def8cf7dd
2 changed files with 27 additions and 3 deletions

View File

@ -362,7 +362,7 @@ big_rectangle_paint(ClutterActor *actor)
if (radius != 0) { if (radius != 0) {
cogl_color_set_from_4ub(&tmp_color, cogl_color_set_from_4ub(&tmp_color,
0xff, 0xff, 0xff, actor_opacity); actor_opacity, actor_opacity, actor_opacity, actor_opacity);
cogl_material_set_color(rectangle->corner_material, &tmp_color); cogl_material_set_color(rectangle->corner_material, &tmp_color);
cogl_set_source(rectangle->corner_material); cogl_set_source(rectangle->corner_material);
@ -401,6 +401,7 @@ big_rectangle_paint(ClutterActor *actor)
border_color->green, border_color->green,
border_color->blue, border_color->blue,
actor_opacity * border_color->alpha / 255); actor_opacity * border_color->alpha / 255);
cogl_color_premultiply (&tmp_color);
cogl_material_set_color(rectangle->border_material, &tmp_color); cogl_material_set_color(rectangle->border_material, &tmp_color);
cogl_set_source(rectangle->border_material); cogl_set_source(rectangle->border_material);
@ -429,6 +430,7 @@ big_rectangle_paint(ClutterActor *actor)
color->green, color->green,
color->blue, color->blue,
actor_opacity * color->alpha / 255); actor_opacity * color->alpha / 255);
cogl_color_premultiply (&tmp_color);
cogl_material_set_color(rectangle->background_material, &tmp_color); cogl_material_set_color(rectangle->background_material, &tmp_color);
cogl_set_source(rectangle->background_material); cogl_set_source(rectangle->background_material);

View File

@ -980,6 +980,7 @@ update_root_window_pixmap (ShellGlobal *global)
gulong nitems; gulong nitems;
gulong bytes_after; gulong bytes_after;
guchar *data; guchar *data;
Pixmap root_pixmap_id = None;
if (!XGetWindowProperty (gdk_x11_get_default_xdisplay (), if (!XGetWindowProperty (gdk_x11_get_default_xdisplay (),
gdk_x11_get_default_root_xwindow (), gdk_x11_get_default_root_xwindow (),
@ -994,8 +995,7 @@ update_root_window_pixmap (ShellGlobal *global)
if (type == XA_PIXMAP && format == 32 && nitems == 1) if (type == XA_PIXMAP && format == 32 && nitems == 1)
{ {
/* Was what we expected. */ /* Was what we expected. */
clutter_x11_texture_pixmap_set_pixmap (CLUTTER_X11_TEXTURE_PIXMAP (global->root_pixmap), root_pixmap_id = *(Pixmap *)data;
*(Pixmap *)data);
} }
else else
{ {
@ -1004,6 +1004,9 @@ update_root_window_pixmap (ShellGlobal *global)
XFree(data); XFree(data);
} }
clutter_x11_texture_pixmap_set_pixmap (CLUTTER_X11_TEXTURE_PIXMAP (global->root_pixmap),
root_pixmap_id);
} }
/* /*
@ -1023,6 +1026,22 @@ root_window_filter (GdkXEvent *native, GdkEvent *event, gpointer data)
return GDK_FILTER_CONTINUE; return GDK_FILTER_CONTINUE;
} }
/* Workaround for a clutter bug where if ClutterGLXTexturePixmap
* is painted without the pixmap being set, a crash will occur inside
* Cogl.
*
* http://bugzilla.openedhand.com/show_bug.cgi?id=1644
*/
static void
root_pixmap_paint (ClutterActor *actor, gpointer data)
{
Pixmap pixmap;
g_object_get (G_OBJECT (actor), "pixmap", &pixmap, NULL);
if (!pixmap)
g_signal_stop_emission_by_name (actor, "paint");
}
/* /*
* Called when the root window pixmap actor is destroyed. * Called when the root window pixmap actor is destroyed.
*/ */
@ -1068,6 +1087,9 @@ shell_global_create_root_pixmap_actor (ShellGlobal *global)
clutter_container_add_actor (CLUTTER_CONTAINER (stage), clutter_container_add_actor (CLUTTER_CONTAINER (stage),
global->root_pixmap); global->root_pixmap);
g_signal_connect (global->root_pixmap, "paint",
G_CALLBACK (root_pixmap_paint), NULL);
/* This really should never happen; but just in case... */ /* This really should never happen; but just in case... */
g_signal_connect (global->root_pixmap, "destroy", g_signal_connect (global->root_pixmap, "destroy",
G_CALLBACK (root_pixmap_destroy), global); G_CALLBACK (root_pixmap_destroy), global);