From 157405ba45ab523edc4d701706303959a9107528 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 11 May 2007 22:51:42 +0000 Subject: [PATCH] merge r6339-6343 from trunk. explicitly set the window frame borders in Natura because its globbing rules end up setting them and maybe it didn't mean to since they didn't exist then. --- data/themerc.xsd | 37 ++++++++++++++++++++++++--------- openbox/client.c | 2 +- openbox/dock.c | 5 +++-- openbox/frame.c | 13 ------------ openbox/framerender.c | 10 +++++++++ openbox/menuframe.c | 4 ++-- openbox/popup.c | 6 ++++-- render/theme.c | 34 +++++++++++++++++++++++------- render/theme.h | 5 +++-- themes/Natura/openbox-3/themerc | 4 +++- 10 files changed, 79 insertions(+), 41 deletions(-) diff --git a/data/themerc.xsd b/data/themerc.xsd index 5f2a53ae..5401d3cc 100755 --- a/data/themerc.xsd +++ b/data/themerc.xsd @@ -88,16 +88,9 @@ - - - - - - - - + @@ -121,6 +114,7 @@ + @@ -132,9 +126,7 @@ - - @@ -146,15 +138,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/openbox/client.c b/openbox/client.c index 2d68d32b..ffac20d8 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -1645,7 +1645,7 @@ void client_setup_decor_and_functions(ObClient *self) if (!(self->functions & OB_CLIENT_FUNC_ICONIFY)) self->decorations &= ~OB_FRAME_DECOR_ICONIFY; if (!(self->functions & OB_CLIENT_FUNC_RESIZE)) - self->decorations &= ~OB_FRAME_DECOR_GRIPS; + self->decorations &= ~(OB_FRAME_DECOR_GRIPS | OB_FRAME_DECOR_HANDLE); /* can't maximize without moving/resizing */ if (!((self->functions & OB_CLIENT_FUNC_MAXIMIZE) && diff --git a/openbox/dock.c b/openbox/dock.c index 5e61f00f..0cc42285 100644 --- a/openbox/dock.c +++ b/openbox/dock.c @@ -57,7 +57,8 @@ void dock_startup(gboolean reconfig) GList *it; XSetWindowBorder(ob_display, dock->frame, - RrColorPixel(ob_rr_theme->frame_b_color)); + RrColorPixel(ob_rr_theme-> + frame_focused_border_color)); XSetWindowBorderWidth(ob_display, dock->frame, ob_rr_theme->fbwidth); RrAppearanceFree(dock->a_frame); @@ -91,7 +92,7 @@ void dock_startup(gboolean reconfig) &attrib); dock->a_frame = RrAppearanceCopy(ob_rr_theme->a_focused_title); XSetWindowBorder(ob_display, dock->frame, - RrColorPixel(ob_rr_theme->frame_b_color)); + RrColorPixel(ob_rr_theme->frame_focused_border_color)); XSetWindowBorderWidth(ob_display, dock->frame, ob_rr_theme->fbwidth); g_hash_table_insert(window_map, &dock->frame, dock); diff --git a/openbox/frame.c b/openbox/frame.c index 68a64342..6248db7c 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -184,19 +184,6 @@ ObFrame *frame_new(ObClient *client) static void set_theme_statics(ObFrame *self) { /* set colors/appearance/sizes for stuff that doesn't change */ - XSetWindowBorder(ob_display, self->window, - RrColorPixel(ob_rr_theme->frame_b_color)); - XSetWindowBorder(ob_display, self->inner, - RrColorPixel(ob_rr_theme->frame_b_color)); - XSetWindowBorder(ob_display, self->title, - RrColorPixel(ob_rr_theme->frame_b_color)); - XSetWindowBorder(ob_display, self->handle, - RrColorPixel(ob_rr_theme->frame_b_color)); - XSetWindowBorder(ob_display, self->rgrip, - RrColorPixel(ob_rr_theme->frame_b_color)); - XSetWindowBorder(ob_display, self->lgrip, - RrColorPixel(ob_rr_theme->frame_b_color)); - XResizeWindow(ob_display, self->max, ob_rr_theme->button_size, ob_rr_theme->button_size); XResizeWindow(ob_display, self->iconify, diff --git a/openbox/framerender.c b/openbox/framerender.c index 21474380..97d5ef53 100644 --- a/openbox/framerender.c +++ b/openbox/framerender.c @@ -42,6 +42,16 @@ void framerender_frame(ObFrame *self) RrColorPixel(ob_rr_theme->cb_unfocused_color)); XSetWindowBackground(ob_display, self->inner, px); XClearWindow(ob_display, self->inner); + + px = (self->focused ? + RrColorPixel(ob_rr_theme->frame_focused_border_color) : + RrColorPixel(ob_rr_theme->frame_unfocused_border_color)); + XSetWindowBorder(ob_display, self->window, px); + XSetWindowBorder(ob_display, self->inner, px); + XSetWindowBorder(ob_display, self->title, px); + XSetWindowBorder(ob_display, self->handle, px); + XSetWindowBorder(ob_display, self->rgrip, px); + XSetWindowBorder(ob_display, self->lgrip, px); } if (self->decorations & OB_FRAME_DECOR_TITLEBAR) { diff --git a/openbox/menuframe.c b/openbox/menuframe.c index 87b8f328..fad41614 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -89,7 +89,7 @@ ObMenuFrame* menu_frame_new(ObMenu *menu, guint show_from, ObClient *client) XSetWindowBorderWidth(ob_display, self->window, ob_rr_theme->mbwidth); XSetWindowBorder(ob_display, self->window, - RrColorPixel(ob_rr_theme->menu_b_color)); + RrColorPixel(ob_rr_theme->menu_border_color)); self->a_title = RrAppearanceCopy(ob_rr_theme->a_menu_title); self->a_items = RrAppearanceCopy(ob_rr_theme->a_menu); @@ -689,7 +689,7 @@ void menu_frame_render(ObMenuFrame *self) XMoveWindow(ob_display, e->window, e->area.x-e->border, e->area.y-e->border); XSetWindowBorderWidth(ob_display, e->window, e->border); XSetWindowBorder(ob_display, e->window, - RrColorPixel(ob_rr_theme->menu_b_color)); + RrColorPixel(ob_rr_theme->menu_border_color)); text_a = (e->entry->type == OB_MENU_ENTRY_TYPE_NORMAL && diff --git a/openbox/popup.c b/openbox/popup.c index e3d52e49..156ce860 100644 --- a/openbox/popup.c +++ b/openbox/popup.c @@ -52,7 +52,8 @@ ObPopup *popup_new() InputOutput, RrVisual(ob_rr_inst), 0, NULL); XSetWindowBorderWidth(ob_display, self->bg, ob_rr_theme->fbwidth); - XSetWindowBorder(ob_display, self->bg, ob_rr_theme->frame_b_color->pixel); + XSetWindowBorder(ob_display, self->bg, + RrColorPixel(ob_rr_theme->frame_focused_border_color)); XMapWindow(ob_display, self->text); @@ -487,7 +488,8 @@ void pager_popup_delay_show(ObPagerPopup *self, gulong usec, for (i = self->desks; i < screen_num_desktops; ++i) { XSetWindowAttributes attr; - attr.border_pixel = RrColorPixel(ob_rr_theme->frame_b_color); + attr.border_pixel = + RrColorPixel(ob_rr_theme->frame_focused_border_color); self->wins[i] = XCreateWindow(ob_display, self->popup->bg, 0, 0, 1, 1, ob_rr_theme->fbwidth, RrDepth(ob_rr_inst), InputOutput, diff --git a/render/theme.c b/render/theme.c index f0cd120a..87d65f86 100644 --- a/render/theme.c +++ b/render/theme.c @@ -173,6 +173,10 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, if (!read_int(db, "border.width", &theme->fbwidth) || theme->fbwidth < 0 || theme->fbwidth > 100) theme->fbwidth = 1; + /* menu border width inherits from the frame border width */ + if (!read_int(db, "menu.border.width", &theme->mbwidth) || + theme->mbwidth < 0 || theme->mbwidth > 100) + theme->mbwidth = theme->fbwidth; theme->mbwidth = theme->fbwidth; if (!read_int(db, "window.client.padding.width", &theme->cbwidthx) || theme->cbwidthx < 0 || theme->cbwidthx > 100) @@ -181,12 +185,25 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, /* load colors */ if (!read_color(db, inst, - "border.color", &theme->frame_b_color)) - theme->frame_b_color = RrColorNew(inst, 0, 0, 0); - theme->menu_b_color = RrColorNew(inst, - theme->frame_b_color->r, - theme->frame_b_color->g, - theme->frame_b_color->b); + "window.active.border.color", + &theme->frame_focused_border_color) && + !read_color(db, inst, + "border.color", + &theme->frame_focused_border_color)) + theme->frame_focused_border_color = RrColorNew(inst, 0, 0, 0); + /* unfocused border color inherits from frame focused border color */ + if (!read_color(db, inst, + "window.inactive.border.color", + &theme->frame_unfocused_border_color)) + theme->frame_unfocused_border_color = RrColorNew(inst, 0, 0, 0); + /* menu border color inherits from frame focused border color */ + if (!read_color(db, inst, + "menu.border.color", + &theme->menu_border_color)) + theme->menu_border_color = RrColorNew(inst, + theme->frame_focused_border_color->r, + theme->frame_focused_border_color->g, + theme->frame_focused_border_color->b); if (!read_color(db, inst, "window.active.client.color", &theme->cb_focused_color)) @@ -1233,8 +1250,9 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, void RrThemeFree(RrTheme *theme) { if (theme) { - RrColorFree(theme->menu_b_color); - RrColorFree(theme->frame_b_color); + RrColorFree(theme->menu_border_color); + RrColorFree(theme->frame_focused_border_color); + RrColorFree(theme->frame_unfocused_border_color); RrColorFree(theme->cb_unfocused_color); RrColorFree(theme->cb_focused_color); RrColorFree(theme->title_focused_color); diff --git a/render/theme.h b/render/theme.h index 85e5aa73..4e87fb12 100644 --- a/render/theme.h +++ b/render/theme.h @@ -57,8 +57,9 @@ struct _RrTheme { gint menu_title_height; /* style settings - colors */ - RrColor *menu_b_color; - RrColor *frame_b_color; + RrColor *menu_border_color; + RrColor *frame_focused_border_color; + RrColor *frame_unfocused_border_color; RrColor *cb_focused_color; RrColor *cb_unfocused_color; RrColor *title_focused_color; diff --git a/themes/Natura/openbox-3/themerc b/themes/Natura/openbox-3/themerc index 99add829..f09a7982 100644 --- a/themes/Natura/openbox-3/themerc +++ b/themes/Natura/openbox-3/themerc @@ -7,7 +7,9 @@ window.client.padding.width: 0 border.Width: 1 padding.width: 2 -border.color: #000000 +window.active.border.color: #000000 +window.inactive.border.color: #000000 +menu.border.color: #000000 menu.overlap: 0 window.frameColor: #eeeeee window.*.client.color: #eeeeee -- 2.34.1