[metacity] libmetacity: don't ignore background and alpha attributes



commit fe84e92a2e304f64eb2cd26a968320c54bc30c46
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Jun 3 03:15:22 2016 +0300

    libmetacity: don't ignore background and alpha attributes
    
    <frame_style> has background and alpha attributes which is ignored
    since 78c283c646a69d86d0e708c39fed6dfa131663ab commit.

 libmetacity/meta-theme-metacity.c |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)
---
diff --git a/libmetacity/meta-theme-metacity.c b/libmetacity/meta-theme-metacity.c
index 533bd37..b3cc17a 100644
--- a/libmetacity/meta-theme-metacity.c
+++ b/libmetacity/meta-theme-metacity.c
@@ -5279,6 +5279,7 @@ meta_theme_metacity_draw_frame (MetaThemeImpl           *impl,
   PangoRectangle extents;
   MetaDrawInfo draw_info;
   const MetaFrameBorders *borders;
+  GtkStyleContext *context;
 
   /* We opt out of GTK+ HiDPI handling, so we have to do the scaling
    * ourselves; the nitty-gritty is a bit confusing, so here is an overview:
@@ -5359,6 +5360,21 @@ meta_theme_metacity_draw_frame (MetaThemeImpl           *impl,
   cairo_save (cr);
   clip_to_rounded_corners (cr, visible_rect, fgeom);
 
+  context = meta_style_info_get_style (style_info, META_STYLE_ELEMENT_WINDOW);
+
+  if (style->window_background_color != NULL)
+    {
+      GdkRGBA color;
+
+      meta_color_spec_render (style->window_background_color, context, &color);
+
+      if (meta_theme_impl_get_composited (impl))
+        color.alpha = style->window_background_alpha / 255.0;
+
+      gdk_cairo_set_source_rgba (cr, &color);
+      cairo_paint (cr);
+    }
+
   /* The enum is in the order the pieces should be rendered. */
   i = 0;
   while (i < META_FRAME_PIECE_LAST)
@@ -5449,11 +5465,6 @@ meta_theme_metacity_draw_frame (MetaThemeImpl           *impl,
 
           if (op_list)
             {
-              GtkStyleContext *context;
-
-              context = meta_style_info_get_style (style_info,
-                                                   META_STYLE_ELEMENT_WINDOW);
-
               meta_draw_op_list_draw_with_style (op_list, context, cr,
                                                  &draw_info, rect);
             }
@@ -5491,11 +5502,6 @@ meta_theme_metacity_draw_frame (MetaThemeImpl           *impl,
 
                   if (gdk_cairo_get_clip_rectangle (cr, NULL))
                     {
-                      GtkStyleContext *context;
-
-                      context = meta_style_info_get_style (style_info,
-                                                           META_STYLE_ELEMENT_WINDOW);
-
                       meta_draw_op_list_draw_with_style (op_list, context, cr,
                                                          &draw_info, rect);
                     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]