summaryrefslogtreecommitdiff
path: root/render/font.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-03-02 02:23:00 +0000
committerDana Jansens <danakj@orodu.net>2007-03-02 02:23:00 +0000
commit78af5d15e9dd94959786811e9eddfa1e5024067c (patch)
tree99609d208f06c9a97108fc881d736baa5912e547 /render/font.c
parent2b99b62abf3441bc69c7c189da05a709edbb49f3 (diff)
this includes a number of things since my magnificent return....
1. some random compiling/style cleanups 2. some bigfixes - mislogic in per-window-settings and focusing new windows - use client_can_focus rather than checking variables for directional focus - MAYBE fix all those lock-ups forever. using event_curtime (a new variable) now instead of event_lasttime. event_lasttime is still used however when the event being processed did not have a time associated with it. this may or may not be a problem, and will be seen. 3. um.. i forget 4. oh yeah, 3rd party docks are now treated like the internal ob dock irt focus. that is, clicking on them won't pass them focus. this is going to be ratified as expected behavior in the wm-spec just now. if docks/panels want focus they can request it with _net_active_window, and then they can have all the focus they want! one day alt-tabbing around dock windows might be nice. but not until the ob dock is moved out into a separate application. going to have to add a wmapp selection and stuff for that though... ugly. who uses wmdockapps anymore !? someone must.. *sigh*
Diffstat (limited to 'render/font.c')
-rw-r--r--render/font.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/render/font.c b/render/font.c
index 0521e2af..14b9ea14 100644
--- a/render/font.c
+++ b/render/font.c
@@ -116,12 +116,12 @@ static RrFont *openfont(const RrInstance *inst, gchar *fontstring)
if (FcPatternGetString(match, "style", 0, &tmp_string) !=
FcResultTypeMismatch) {
/* Bold ? */
- if (!strcasecmp("bold", (gchar *)tmp_string)) {
+ if (!g_ascii_strcasecmp("bold", (gchar *)tmp_string)) {
pango_font_description_set_weight(out->pango_font_description,
PANGO_WEIGHT_BOLD);
}
/* Italic ? */
- else if (!strcasecmp("italic", (gchar *)tmp_string)) {
+ else if (!g_ascii_strcasecmp("italic", (gchar *)tmp_string)) {
pango_font_description_set_style(out->pango_font_description,
PANGO_STYLE_ITALIC);
}
@@ -135,19 +135,23 @@ static RrFont *openfont(const RrInstance *inst, gchar *fontstring)
}
/* based on gtkmain.c gtk_get_default_language() */
- gchar *locale, *p;
- locale = g_strdup(setlocale(LC_CTYPE, NULL));
- if ((p = strchr(locale, '.')))
- *p = '\0';
- if ((p = strchr(locale, '@')))
- *p = '\0';
- PangoFontMetrics *metrics =
- pango_context_get_metrics(context, out->pango_font_description,
- pango_language_from_string(locale));
- out->pango_ascent = pango_font_metrics_get_ascent(metrics);
- out->pango_descent = pango_font_metrics_get_descent(metrics);
- g_free(locale);
- pango_font_metrics_unref(metrics);
+ {
+ gchar *locale, *p;
+ PangoFontMetrics *metrics;
+
+ locale = g_strdup(setlocale(LC_CTYPE, NULL));
+ if ((p = strchr(locale, '.')))
+ *p = '\0';
+ if ((p = strchr(locale, '@')))
+ *p = '\0';
+ metrics =
+ pango_context_get_metrics(context, out->pango_font_description,
+ pango_language_from_string(locale));
+ out->pango_ascent = pango_font_metrics_get_ascent(metrics);
+ out->pango_descent = pango_font_metrics_get_descent(metrics);
+ g_free(locale);
+ pango_font_metrics_unref(metrics);
+ }
#endif /* USE_PANGO */
if (FcPatternGetBool(match, OB_SHADOW, 0, &out->shadow) != FcResultMatch)