X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=render%2Finstance.c;h=91f9db77934ff309d8f8ef05ea67041b21b68d21;hb=0116d82463197bea2890230d71a69e4b92489166;hp=195792498a3ccb9725437cb205fed073bd409512;hpb=35c5a62ca1845e028dec727aede156765ee2ab2d;p=chaz%2Fopenbox diff --git a/render/instance.c b/render/instance.c index 19579249..91f9db77 100644 --- a/render/instance.c +++ b/render/instance.c @@ -1,7 +1,8 @@ /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*- instance.c for the Openbox window manager - Copyright (c) 2003 Ben Jansens + Copyright (c) 2006 Mikael Magnusson + Copyright (c) 2003-2007 Dana Jansens This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -56,6 +57,8 @@ void print_refs(gint id) RrInstance* RrInstanceNew (Display *display, gint screen) { + g_type_init(); /* supposedly needed for pango but seems to work without */ + definst = g_new (RrInstance, 1); definst->display = display; definst->screen = screen; @@ -63,6 +66,7 @@ RrInstance* RrInstanceNew (Display *display, gint screen) definst->depth = DefaultDepth(display, screen); definst->visual = DefaultVisual(display, screen); definst->colormap = DefaultColormap(display, screen); + definst->pango = pango_xft_get_context(display, screen); definst->pseudo_colors = NULL; @@ -130,7 +134,7 @@ void RrPseudoColorSetup (RrInstance *inst) _ncolors = RrPseudoNcolors(inst); if (_ncolors > 1 << inst->depth) { - g_warning("PseudoRenderControl: Invalid colormap size. Resizing.\n"); + g_message("Invalid colormap size. Resizing."); inst->pseudo_bpc = 1 << (inst->depth/3) >> 3; _ncolors = 1 << (inst->pseudo_bpc * 3); } @@ -209,6 +213,8 @@ void RrInstanceFree (RrInstance *inst) if (inst == definst) definst = NULL; g_free(inst->pseudo_colors); g_hash_table_destroy(inst->color_hash); + g_object_unref(inst->pango); + g_free(inst); } }