weston: Clip window title text to the frame
authorMartin Minarik <minarik11@student.fiit.stuba.sk>
Mon, 2 Jul 2012 21:05:50 +0000 (23:05 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Mon, 9 Jul 2012 21:28:09 +0000 (17:28 -0400)
Fixes an issue with text overflowing the available frame space.

shared/cairo-util.c

index 649ed98..c64ace2 100644 (file)
@@ -401,6 +401,11 @@ theme_render_frame(struct theme *t,
                    width - t->margin * 2, height - t->margin * 2,
                    t->width, t->titlebar_height);
 
+       cairo_rectangle (cr, t->margin + t->width, t->margin,
+                        width - (t->margin + t->width) * 2,
+                        t->titlebar_height - t->width);
+       cairo_clip(cr);
+
        cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
        cairo_select_font_face(cr, "sans",
                               CAIRO_FONT_SLANT_NORMAL,