summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberts Muktupāvels <alberts.muktupavels@gmail.com>2017-07-21 00:29:30 +0300
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2017-07-21 00:29:30 +0300
commit27c6ce852ea70e45d77bf3a9d271cc35f8d7466f (patch)
treed4e78f175c417bba6e3f35a403f17e1a6dc0fb68
parent58edf09694c35c35962c0a12f48f871dcb5b2562 (diff)
downloadmetacity-27c6ce852ea70e45d77bf3a9d271cc35f8d7466f.tar.gz
libmetacity: set a clip region for title
-rw-r--r--libmetacity/meta-theme-gtk.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libmetacity/meta-theme-gtk.c b/libmetacity/meta-theme-gtk.c
index 8f224b2c..a7123b00 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);