Make the default background for GdkWindows transparent

With the changes in default CSS to make the default background transparent
we ran into issues where intermediate GdkWindow (for instance the
view_window in GtkViewport) where we didn't set an explicit background
(because before they were always covered). So instead of showing throught
the transparent windows were showing the default backgroind of the intermediate
window (i.e. black).

With this change we also needed to fix GtkViewport, as it was previously
relying on the bin and view windows to cover widget->window so that the
border was not visible if shadow_type was NONE.
This commit is contained in:
Alexander Larsson 2012-02-09 16:38:54 +01:00
parent 6723feae8a
commit fed1cfb122
2 changed files with 4 additions and 2 deletions

View File

@ -1420,7 +1420,8 @@ gdk_window_new (GdkWindow *parent,
window->depth = window->visual->depth;
/* XXX: Cache this somehow? */
window->background = cairo_pattern_create_rgb (0, 0, 0);
window->background = cairo_pattern_create_rgba (0, 0, 0, 0);
window->has_alpha_background = TRUE;
}
else
{

View File

@ -755,7 +755,8 @@ gtk_viewport_draw (GtkWidget *widget,
context = gtk_widget_get_style_context (widget);
if (gtk_cairo_should_draw_window (cr, gtk_widget_get_window (widget)))
if (gtk_cairo_should_draw_window (cr, gtk_widget_get_window (widget)) &&
priv->shadow_type != GTK_SHADOW_NONE)
{
gtk_style_context_save (context);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_FRAME);