X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=render%2Finstance.c;h=a9b70ffe47987942b1c9cb787576b4ef7f4f7363;hb=9d1949f0b168650e38dcb9adf1ad93e8b90a9b44;hp=ca5845192713019ea032846f83e17255fe06e9ff;hpb=740c5b2a20d5110435d0874f8cc6a4c9dfd14777;p=chaz%2Fopenbox diff --git a/render/instance.c b/render/instance.c index ca584519..a9b70ffe 100644 --- a/render/instance.c +++ b/render/instance.c @@ -1,6 +1,7 @@ /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*- instance.c for the Openbox window manager + Copyright (c) 2006 Mikael Magnusson Copyright (c) 2003 Ben Jansens This program is free software; you can redistribute it and/or modify @@ -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; @@ -115,7 +119,7 @@ void RrTrueColorSetup (RrInstance *inst) XFree(timage); } -#define RrPseudoNcolors(isnt) (1 << (inst->pseudo_bpc * 3)) +#define RrPseudoNcolors(inst) (1 << (inst->pseudo_bpc * 3)) void RrPseudoColorSetup (RrInstance *inst) { @@ -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); } }