X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fframerender.c;h=bf71d2c34a937097f59557a6f320a49196839aa0;hb=22a88cfe99d897dc7d3be7b53b954f6cdfa250c6;hp=8cb5910f4f32b083f86ed762da293190e7e53ed0;hpb=77baf26a7f2f64ddf1274035fd4991ab17345904;p=chaz%2Fopenbox diff --git a/openbox/framerender.c b/openbox/framerender.c index 8cb5910f..bf71d2c3 100644 --- a/openbox/framerender.c +++ b/openbox/framerender.c @@ -49,59 +49,67 @@ void framerender_frame(ObFrame *self) RrColorPixel(ob_rr_theme->cb_focused_color) : RrColorPixel(ob_rr_theme->cb_unfocused_color)); - XSetWindowBackground(ob_display, self->backback, px); - XClearWindow(ob_display, self->backback); - XSetWindowBackground(ob_display, self->innerleft, px); - XClearWindow(ob_display, self->innerleft); - XSetWindowBackground(ob_display, self->innertop, px); - XClearWindow(ob_display, self->innertop); - XSetWindowBackground(ob_display, self->innerright, px); - XClearWindow(ob_display, self->innerright); - XSetWindowBackground(ob_display, self->innerbottom, px); - XClearWindow(ob_display, self->innerbottom); + XSetWindowBackground(obt_display, self->backback, px); + XClearWindow(obt_display, self->backback); + XSetWindowBackground(obt_display, self->innerleft, px); + XClearWindow(obt_display, self->innerleft); + XSetWindowBackground(obt_display, self->innertop, px); + XClearWindow(obt_display, self->innertop); + XSetWindowBackground(obt_display, self->innerright, px); + XClearWindow(obt_display, self->innerright); + XSetWindowBackground(obt_display, self->innerbottom, px); + XClearWindow(obt_display, self->innerbottom); + XSetWindowBackground(obt_display, self->innerbll, px); + XClearWindow(obt_display, self->innerbll); + XSetWindowBackground(obt_display, self->innerbrr, px); + XClearWindow(obt_display, self->innerbrr); + XSetWindowBackground(obt_display, self->innerblb, px); + XClearWindow(obt_display, self->innerblb); + XSetWindowBackground(obt_display, self->innerbrb, px); + XClearWindow(obt_display, self->innerbrb); px = (self->focused ? RrColorPixel(ob_rr_theme->frame_focused_border_color) : RrColorPixel(ob_rr_theme->frame_unfocused_border_color)); - XSetWindowBackground(ob_display, self->left, px); - XClearWindow(ob_display, self->left); - XSetWindowBackground(ob_display, self->right, px); - XClearWindow(ob_display, self->right); - - XSetWindowBackground(ob_display, self->titleleft, px); - XClearWindow(ob_display, self->titleleft); - XSetWindowBackground(ob_display, self->titletop, px); - XClearWindow(ob_display, self->titletop); - XSetWindowBackground(ob_display, self->titletopleft, px); - XClearWindow(ob_display, self->titletopleft); - XSetWindowBackground(ob_display, self->titletopright, px); - XClearWindow(ob_display, self->titletopright); - XSetWindowBackground(ob_display, self->titleright, px); - XClearWindow(ob_display, self->titleright); - - XSetWindowBackground(ob_display, self->handleleft, px); - XClearWindow(ob_display, self->handleleft); - XSetWindowBackground(ob_display, self->handletop, px); - XClearWindow(ob_display, self->handletop); - XSetWindowBackground(ob_display, self->handleright, px); - XClearWindow(ob_display, self->handleright); - XSetWindowBackground(ob_display, self->handlebottom, px); - XClearWindow(ob_display, self->handlebottom); - - XSetWindowBackground(ob_display, self->lgripleft, px); - XClearWindow(ob_display, self->lgripleft); - XSetWindowBackground(ob_display, self->lgriptop, px); - XClearWindow(ob_display, self->lgriptop); - XSetWindowBackground(ob_display, self->lgripbottom, px); - XClearWindow(ob_display, self->lgripbottom); - - XSetWindowBackground(ob_display, self->rgripright, px); - XClearWindow(ob_display, self->rgripright); - XSetWindowBackground(ob_display, self->rgriptop, px); - XClearWindow(ob_display, self->rgriptop); - XSetWindowBackground(ob_display, self->rgripbottom, px); - XClearWindow(ob_display, self->rgripbottom); + XSetWindowBackground(obt_display, self->left, px); + XClearWindow(obt_display, self->left); + XSetWindowBackground(obt_display, self->right, px); + XClearWindow(obt_display, self->right); + + XSetWindowBackground(obt_display, self->titleleft, px); + XClearWindow(obt_display, self->titleleft); + XSetWindowBackground(obt_display, self->titletop, px); + XClearWindow(obt_display, self->titletop); + XSetWindowBackground(obt_display, self->titletopleft, px); + XClearWindow(obt_display, self->titletopleft); + XSetWindowBackground(obt_display, self->titletopright, px); + XClearWindow(obt_display, self->titletopright); + XSetWindowBackground(obt_display, self->titleright, px); + XClearWindow(obt_display, self->titleright); + + XSetWindowBackground(obt_display, self->handleleft, px); + XClearWindow(obt_display, self->handleleft); + XSetWindowBackground(obt_display, self->handletop, px); + XClearWindow(obt_display, self->handletop); + XSetWindowBackground(obt_display, self->handleright, px); + XClearWindow(obt_display, self->handleright); + XSetWindowBackground(obt_display, self->handlebottom, px); + XClearWindow(obt_display, self->handlebottom); + + XSetWindowBackground(obt_display, self->lgripleft, px); + XClearWindow(obt_display, self->lgripleft); + XSetWindowBackground(obt_display, self->lgriptop, px); + XClearWindow(obt_display, self->lgriptop); + XSetWindowBackground(obt_display, self->lgripbottom, px); + XClearWindow(obt_display, self->lgripbottom); + + XSetWindowBackground(obt_display, self->rgripright, px); + XClearWindow(obt_display, self->rgripright); + XSetWindowBackground(obt_display, self->rgriptop, px); + XClearWindow(obt_display, self->rgriptop); + XSetWindowBackground(obt_display, self->rgripbottom, px); + XClearWindow(obt_display, self->rgripbottom); /* don't use the separator color for shaded windows */ if (!self->client->shaded) @@ -109,17 +117,15 @@ void framerender_frame(ObFrame *self) RrColorPixel(ob_rr_theme->title_separator_focused_color) : RrColorPixel(ob_rr_theme->title_separator_unfocused_color)); - XSetWindowBackground(ob_display, self->titlebottom, px); - XClearWindow(ob_display, self->titlebottom); + XSetWindowBackground(obt_display, self->titlebottom, px); + XClearWindow(obt_display, self->titlebottom); } if (self->decorations & OB_FRAME_DECOR_TITLEBAR) { RrAppearance *t, *l, *m, *n, *i, *d, *s, *c, *clear; if (self->focused) { - - t = self->a_focused_title; - l = self->a_focused_label; - + t = ob_rr_theme->a_focused_title; + l = ob_rr_theme->a_focused_label; m = (!(self->decorations & OB_FRAME_DECOR_MAXIMIZE) ? ob_rr_theme->a_disabled_focused_max : (self->client->max_vert || self->client->max_horz ? @@ -133,7 +139,7 @@ void framerender_frame(ObFrame *self) (self->max_hover ? ob_rr_theme->a_hover_focused_max : ob_rr_theme->a_focused_unpressed_max)))); - n = self->a_icon; + n = ob_rr_theme->a_icon; i = (!(self->decorations & OB_FRAME_DECOR_ICONIFY) ? ob_rr_theme->a_disabled_focused_iconify : (self->iconify_press ? @@ -175,8 +181,8 @@ void framerender_frame(ObFrame *self) ob_rr_theme->a_hover_focused_close : ob_rr_theme->a_focused_unpressed_close))); } else { - t = self->a_unfocused_title; - l = self->a_unfocused_label; + t = ob_rr_theme->a_unfocused_title; + l = ob_rr_theme->a_unfocused_label; m = (!(self->decorations & OB_FRAME_DECOR_MAXIMIZE) ? ob_rr_theme->a_disabled_unfocused_max : (self->client->max_vert || self->client->max_horz ? @@ -190,7 +196,7 @@ void framerender_frame(ObFrame *self) (self->max_hover ? ob_rr_theme->a_hover_unfocused_max : ob_rr_theme->a_unfocused_unpressed_max)))); - n = self->a_icon; + n = ob_rr_theme->a_icon; i = (!(self->decorations & OB_FRAME_DECOR_ICONIFY) ? ob_rr_theme->a_disabled_unfocused_iconify : (self->iconify_press ? @@ -310,7 +316,7 @@ void framerender_frame(ObFrame *self) RrAppearance *h, *g; h = (self->focused ? - self->a_focused_handle : self->a_unfocused_handle); + ob_rr_theme->a_focused_handle : ob_rr_theme->a_unfocused_handle); RrPaint(h, self->handle, self->width, ob_rr_theme->handle_height); @@ -335,7 +341,7 @@ void framerender_frame(ObFrame *self) } } - XFlush(ob_display); + XFlush(obt_display); } static void framerender_label(ObFrame *self, RrAppearance *a) @@ -348,21 +354,21 @@ static void framerender_label(ObFrame *self, RrAppearance *a) static void framerender_icon(ObFrame *self, RrAppearance *a) { - const ObClientIcon *icon; + RrImage *icon; if (!self->icon_on) return; - icon = client_icon(self->client, - ob_rr_theme->button_size + 2, - ob_rr_theme->button_size + 2); + icon = client_icon(self->client); + 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; - a->texture[0].data.rgba.alpha = 0xff; - a->texture[0].data.rgba.data = icon->data; - } else + RrAppearanceClearTextures(a); + a->texture[0].type = RR_TEXTURE_IMAGE; + a->texture[0].data.image.alpha = 0xff; + a->texture[0].data.image.image = icon; + } else { + RrAppearanceClearTextures(a); a->texture[0].type = RR_TEXTURE_NONE; + } RrPaint(a, self->icon, ob_rr_theme->button_size + 2, ob_rr_theme->button_size + 2);