diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2019-10-16 14:58:30 +0300 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2019-10-16 14:58:30 +0300 |
commit | ef433bd7dec58cc9f062e0cda57cb259ff3745f1 (patch) | |
tree | 786c5798f2165a7593bb1f58dd73baec621c5025 | |
parent | 68bd30a47d2433765c3d38570e36ce73858e1394 (diff) | |
download | metacity-ef433bd7dec58cc9f062e0cda57cb259ff3745f1.tar.gz |
libmetacity: fix blurry titlebar font
https://gitlab.gnome.org/GNOME/metacity/issues/2
-rw-r--r-- | libmetacity/meta-theme-gtk.c | 4 | ||||
-rw-r--r-- | 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 |