X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=openbox%2Fframerender.c;h=7356a3833d99446f9796d1965fba11c34839d18d;hb=def76092b587e7e9a2b212dc5211773e336525e1;hp=a9025b302cf04005e65fb83de2f903a256e922b2;hpb=420cbea6cc911296fdee62d0af336f4eda48d303;p=chaz%2Fopenbox diff --git a/openbox/framerender.c b/openbox/framerender.c index a9025b30..7356a383 100644 --- a/openbox/framerender.c +++ b/openbox/framerender.c @@ -1,3 +1,21 @@ +/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*- + + framerender.c for the Openbox window manager + Copyright (c) 2003 Ben 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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + See the COPYING file for a copy of the GNU General Public License. +*/ + #include "frame.h" #include "openbox.h" #include "screen.h" @@ -16,7 +34,7 @@ static void framerender_close(ObFrame *self, RrAppearance *a); void framerender_frame(ObFrame *self) { { - unsigned long px; + gulong px; px = (self->focused ? RrColorPixel(ob_rr_theme->cb_focused_color) : @@ -140,31 +158,31 @@ void framerender_frame(ObFrame *self) /* set parents for any parent relative guys */ l->surface.parent = t; l->surface.parentx = self->label_x; - l->surface.parenty = ob_rr_theme->bevel; + l->surface.parenty = ob_rr_theme->padding; m->surface.parent = t; m->surface.parentx = self->max_x; - m->surface.parenty = ob_rr_theme->bevel + 1; + m->surface.parenty = ob_rr_theme->padding + 1; n->surface.parent = t; n->surface.parentx = self->icon_x; - n->surface.parenty = ob_rr_theme->bevel; + n->surface.parenty = ob_rr_theme->padding; i->surface.parent = t; i->surface.parentx = self->iconify_x; - i->surface.parenty = ob_rr_theme->bevel + 1; + i->surface.parenty = ob_rr_theme->padding + 1; d->surface.parent = t; d->surface.parentx = self->desk_x; - d->surface.parenty = ob_rr_theme->bevel + 1; + d->surface.parenty = ob_rr_theme->padding + 1; s->surface.parent = t; s->surface.parentx = self->shade_x; - s->surface.parenty = ob_rr_theme->bevel + 1; + s->surface.parenty = ob_rr_theme->padding + 1; c->surface.parent = t; c->surface.parentx = self->close_x; - c->surface.parenty = ob_rr_theme->bevel + 1; + c->surface.parenty = ob_rr_theme->padding + 1; framerender_label(self, l); framerender_max(self, m); @@ -217,12 +235,14 @@ static void framerender_label(ObFrame *self, RrAppearance *a) static void framerender_icon(ObFrame *self, RrAppearance *a) { + const ObClientIcon *icon; + if (self->icon_x < 0) return; - if (self->client->nicons) { - ObClientIcon *icon = client_icon(self->client, - ob_rr_theme->button_size + 2, - ob_rr_theme->button_size + 2); + icon = client_icon(self->client, + ob_rr_theme->button_size + 2, + ob_rr_theme->button_size + 2); + if (icon) { a->texture[0].type = RR_TEXTURE_RGBA; a->texture[0].data.rgba.width = icon->width; a->texture[0].data.rgba.height = icon->height;