[metacity] libmetacity: set a clip region for title
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [metacity] libmetacity: set a clip region for title
- Date: Thu, 20 Jul 2017 22:22:26 +0000 (UTC)
commit 27c6ce852ea70e45d77bf3a9d271cc35f8d7466f
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Jul 21 00:29:30 2017 +0300
    libmetacity: set a clip region for title
 libmetacity/meta-theme-gtk.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/libmetacity/meta-theme-gtk.c b/libmetacity/meta-theme-gtk.c
index 8f224b2..a7123b0 100644
--- a/libmetacity/meta-theme-gtk.c
+++ b/libmetacity/meta-theme-gtk.c
@@ -747,8 +747,19 @@ meta_theme_gtk_draw_frame (MetaThemeImpl           *impl,
       else if (x + text_width > (fgeom->title_rect.x + fgeom->title_rect.width) / scale)
         x = (fgeom->title_rect.x + fgeom->title_rect.width) / scale - text_width;
 
+      cairo_save (cr);
+
+      cairo_rectangle (cr,
+                       fgeom->title_rect.x / scale,
+                       fgeom->title_rect.y / scale,
+                       fgeom->title_rect.width / scale,
+                       fgeom->title_rect.height / scale);
+      cairo_clip (cr);
+
       context = meta_style_info_get_style (style_info, META_STYLE_ELEMENT_TITLE);
       gtk_render_layout (context, cr, x, y, title_layout);
+
+      cairo_restore (cr);
     }
 
   context = meta_style_info_get_style (style_info, META_STYLE_ELEMENT_BUTTON);
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]