From cd3d0dc954158d73b65dd1e5caf5b09b23670195 Mon Sep 17 00:00:00 2001 From: Carlos Pita Date: Sun, 2 Oct 2011 22:47:47 -0300 Subject: [PATCH] Specific border width/color for undecorated active/inactive windows --- obrender/theme.c | 11 ++++++++++- obrender/theme.h | 3 +++ openbox/frame.c | 2 +- openbox/framerender.c | 10 +++++++--- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/obrender/theme.c b/obrender/theme.c index 5f14065..582ddad 100644 --- a/obrender/theme.c +++ b/obrender/theme.c @@ -259,6 +259,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name, READ_INT("border.width", theme->fbwidth, 0, 100, 1); READ_INT("menu.border.width", theme->mbwidth, 0, 100, theme->fbwidth); READ_INT("osd.border.width", theme->obwidth, 0, 100, theme->fbwidth); + READ_INT("undecorated.border.width", theme->ubwidth, 0, 100, theme->fbwidth); READ_INT("menu.separator.width", theme->menu_sep_width, 1, 100, 1); READ_INT("menu.separator.padding.width", theme->menu_sep_paddingx, 0, 100, 6); READ_INT("menu.separator.padding.height", theme->menu_sep_paddingy, 0, 100, 3); @@ -270,7 +271,10 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name, /* load colors */ READ_COLOR_("window.active.border.color", "border.color", theme->frame_focused_border_color, RrColorNew(inst, 0, 0, 0)); - + /* focused undecorated border color inherits from frame focused border color */ + READ_COLOR("window.undecorated.active.border.color", + theme->frame_undecorated_focused_border_color, + RrColorCopy(theme->frame_focused_border_color)); /* title separator focused color inherits from focused border color */ READ_COLOR("window.active.title.separator.color", theme->title_separator_focused_color, @@ -281,6 +285,11 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name, theme->frame_unfocused_border_color, RrColorCopy(theme->frame_focused_border_color)); + /* unfocused undecorated border color inherits from frame unfocused border color */ + READ_COLOR("window.undecorated.inactive.border.color", + theme->frame_undecorated_unfocused_border_color, + RrColorCopy(theme->frame_unfocused_border_color)); + /* title separator unfocused color inherits from unfocused border color */ READ_COLOR("window.inactive.title.separator.color", theme->title_separator_unfocused_color, diff --git a/obrender/theme.h b/obrender/theme.h index 7ad5b34..eb9ac3f 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_undecorated_focused_border_color; RrColor *frame_unfocused_border_color; + RrColor *frame_undecorated_unfocused_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 3aa3ab7..89d00ee 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -348,7 +348,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 8ddba60..e8442d3 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_undecorated_focused_border_color : + ob_rr_theme->frame_focused_border_color : + self->client->undecorated ? + ob_rr_theme->frame_undecorated_unfocused_border_color : + ob_rr_theme->frame_unfocused_border_color); XSetWindowBackground(obt_display, self->left, px); XClearWindow(obt_display, self->left); -- 1.7.6.3