[metacity/gnome-3-34] libmetacity: fix blurry titlebar font



commit ae883e9678236780e43f5b6846aac3c593c43b49
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Wed Oct 16 14:58:30 2019 +0300

    libmetacity: fix blurry titlebar font
    
    https://gitlab.gnome.org/GNOME/metacity/issues/2

 libmetacity/meta-theme-gtk.c      |  4 +++-
 libmetacity/meta-theme-metacity.c | 42 ++++++++++++++++++++-------------------
 2 files changed, 25 insertions(+), 21 deletions(-)
---
diff --git a/libmetacity/meta-theme-gtk.c b/libmetacity/meta-theme-gtk.c
index 33991cc8..aeedba6d 100644
--- a/libmetacity/meta-theme-gtk.c
+++ b/libmetacity/meta-theme-gtk.c
@@ -730,7 +730,9 @@ meta_theme_gtk_draw_frame (MetaThemeImpl           *impl,
   if (style->layout->has_title && title_layout)
     {
       PangoRectangle logical;
-      gdouble text_width, x, y;
+      gdouble text_width;
+      int x;
+      int y;
 
       pango_layout_set_width (title_layout, -1);
       pango_layout_get_pixel_extents (title_layout, NULL, &logical);
diff --git a/libmetacity/meta-theme-metacity.c b/libmetacity/meta-theme-metacity.c
index 538fd5a8..e91cac47 100644
--- a/libmetacity/meta-theme-metacity.c
+++ b/libmetacity/meta-theme-metacity.c
@@ -5476,24 +5476,8 @@ meta_theme_metacity_draw_frame (MetaThemeImpl           *impl,
   draw_info.width = fgeom->width / scale;
   draw_info.height = fgeom->height / scale;
 
-  cairo_save (cr);
-  clip_to_rounded_corners (cr, visible_rect, fgeom, scale);
-
   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)
@@ -5564,8 +5548,28 @@ meta_theme_metacity_draw_frame (MetaThemeImpl           *impl,
 
       cairo_save (cr);
 
-      cairo_rectangle (cr, rect.x, rect.y, rect.width, rect.height);
-      cairo_clip (cr);
+      if (i == META_FRAME_PIECE_ENTIRE_BACKGROUND)
+        {
+          clip_to_rounded_corners (cr, rect, fgeom, scale);
+
+          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);
+            }
+        }
+      else
+        {
+          cairo_rectangle (cr, rect.x, rect.y, rect.width, rect.height);
+          cairo_clip (cr);
+        }
 
       if (gdk_cairo_get_clip_rectangle (cr, NULL))
         {
@@ -5670,8 +5674,6 @@ meta_theme_metacity_draw_frame (MetaThemeImpl           *impl,
 
       ++i;
     }
-
-  cairo_restore (cr);
 }
 
 static void


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