]> Dogcows Code - chaz/openbox/blobdiff - render/font.c
add the DesktopLast action, props to marius nita for this one
[chaz/openbox] / render / font.c
index 9c42fcbcf4b715ee47b3947b11ddb0cc665e15f2..a099c0930812a01bffb2b0be794a817a6f2e43cc 100644 (file)
@@ -2,13 +2,12 @@
 #include "color.h"
 #include "mask.h"
 #include "theme.h"
-#include "kernel/geom.h"
-#include "kernel/gettext.h"
-#define _(str) gettext(str)
+#include "gettext.h"
 
 #include <X11/Xft/Xft.h>
 #include <glib.h>
 #include <string.h>
+#include <stdlib.h>
 
 #define ELIPSES "..."
 #define ELIPSES_LENGTH(font) \
@@ -134,7 +133,7 @@ int RrFontMeasureString(const RrFont *f, const gchar *str)
 {
     gint x, y;
     font_measure_full (f, str, &x, &y);
-    return x;
+    return x + 4;
 }
 
 int RrFontHeight(const RrFont *f)
@@ -148,7 +147,7 @@ int RrFontMaxCharWidth(const RrFont *f)
     return (signed) f->xftfont->max_advance_width;
 }
 
-void RrFontDraw(XftDraw *d, RrTextureText *t, Rect *area)
+void RrFontDraw(XftDraw *d, RrTextureText *t, RrRect *area)
 {
     gint x,y,w,h;
     XftColor c;
@@ -227,5 +226,7 @@ void RrFontDraw(XftDraw *d, RrTextureText *t, Rect *area)
     XftDrawStringUtf8(d, &c, t->font->xftfont, x,
                       t->font->xftfont->ascent + y,
                       (FcChar8*)text->str, l);
+
+    g_string_free(text, TRUE);
     return;
 }
This page took 0.026376 seconds and 4 git commands to generate.