From 8bddf1dacf38a483a609ae551f6d17a79517ada0 Mon Sep 17 00:00:00 2001 From: Carlos Pita Date: Wed, 2 Feb 2011 08:12:19 -0300 Subject: [PATCH] Specific border width/color for undecorated active/inactive windows. --- obrender/theme.c | 20 ++++++++++++++++++++ obrender/theme.h | 3 +++ openbox/frame.c | 2 +- openbox/framerender.c | 10 +++++++--- 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/obrender/theme.c b/obrender/theme.c index 838a78f..a93456c 100644 --- a/obrender/theme.c +++ b/obrender/theme.c @@ -209,6 +209,10 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name, if (!read_int(db, "osd.border.width", &theme->obwidth) || theme->obwidth < 0 || theme->obwidth > 100) theme->obwidth = theme->fbwidth; + /* undecorated frame border width inherits from the frame border width */ + if (!read_int(db, "undecorated.border.width", &theme->ubwidth) || + theme->ubwidth < 0 || theme->ubwidth > 100) + theme->ubwidth = theme->fbwidth; if (!read_int(db, "window.client.padding.width", &theme->cbwidthx) || theme->cbwidthx < 0 || theme->cbwidthx > 100) theme->cbwidthx = theme->paddingx; @@ -235,6 +239,14 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name, "border.color", &theme->frame_focused_border_color)) theme->frame_focused_border_color = RrColorNew(inst, 0, 0, 0); + /* focused undecorated border color inherits from frame focused border color */ + if (!read_color(db, inst, + "window.active.undecorated.border.color", + &theme->frame_focused_undecorated_border_color)) + theme->frame_focused_undecorated_border_color = + RrColorNew(inst, theme->frame_focused_border_color->r, + theme->frame_focused_border_color->g, + theme->frame_focused_border_color->b); /* title separator focused color inherits from focused border color */ if (!read_color(db, inst, "window.active.title.separator.color", @@ -252,6 +264,14 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name, RrColorNew(inst, theme->frame_focused_border_color->r, theme->frame_focused_border_color->g, theme->frame_focused_border_color->b); + /* unfocused undecorated border color inherits from frame unfocused border color */ + if (!read_color(db, inst, + "window.inactive.undecorated.border.color", + &theme->frame_unfocused_undecorated_border_color)) + theme->frame_unfocused_undecorated_border_color = + RrColorNew(inst, theme->frame_unfocused_border_color->r, + theme->frame_unfocused_border_color->g, + theme->frame_unfocused_border_color->b); /* title separator unfocused color inherits from unfocused border color */ if (!read_color(db, inst, "window.inactive.title.separator.color", diff --git a/obrender/theme.h b/obrender/theme.h index 2ffc637..3fd8545 100644 --- a/obrender/theme.h +++ b/obrender/theme.h @@ -44,6 +44,7 @@ struct _RrTheme { gint fbwidth; /*!< frame border width */ gint mbwidth; /*!< menu border width */ gint obwidth; /*!< osd border width */ + gint ubwidth; /*!< undecorated frame border width */ gint cbwidthx; gint cbwidthy; gint menu_overlap_x; @@ -66,7 +67,9 @@ struct _RrTheme { RrColor *menu_border_color; RrColor *osd_border_color; RrColor *frame_focused_border_color; + RrColor *frame_focused_undecorated_border_color; RrColor *frame_unfocused_border_color; + RrColor *frame_unfocused_undecorated_border_color; RrColor *title_separator_focused_color; RrColor *title_separator_unfocused_color; RrColor *cb_focused_color; diff --git a/openbox/frame.c b/openbox/frame.c index 8a9a5a6..1205ae5 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -341,7 +341,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved, self->shaded = self->client->shaded; if (self->decorations & OB_FRAME_DECOR_BORDER) - self->bwidth = ob_rr_theme->fbwidth; + self->bwidth = self->client->undecorated ? ob_rr_theme->ubwidth : ob_rr_theme->fbwidth; else self->bwidth = 0; diff --git a/openbox/framerender.c b/openbox/framerender.c index 28c12ae..0e9bcc1 100644 --- a/openbox/framerender.c +++ b/openbox/framerender.c @@ -68,9 +68,13 @@ void framerender_frame(ObFrame *self) 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)); + px = RrColorPixel(self->focused ? + self->client->undecorated ? + ob_rr_theme->frame_focused_undecorated_border_color : + ob_rr_theme->frame_focused_border_color : + self->client->undecorated ? + ob_rr_theme->frame_unfocused_undecorated_border_color : + ob_rr_theme->frame_unfocused_border_color); XSetWindowBackground(obt_display, self->left, px); XClearWindow(obt_display, self->left); -- 1.7.4