diff --git a/src/config.c b/src/config.c index 32298fe..75276c8 100644 --- a/src/config.c +++ b/src/config.c @@ -163,6 +163,7 @@ conf_client_section(cfg_t *cfg_c) /* Client misc */ conf.client.borderheight = (cfg_getint(cfg_c, "border_height")) ? cfg_getint(cfg_c, "border_height") : 1; + conf.client.border_shadow = cfg_getbool(cfg_c, "border_shadow"); conf.client.place_at_mouse = cfg_getbool(cfg_c, "place_at_mouse"); conf.client.bordernormal = getcolor(alias_to_str(cfg_getstr(cfg_c, "border_normal"))); conf.client.borderfocus = getcolor(alias_to_str(cfg_getstr(cfg_c, "border_focus"))); diff --git a/src/config_struct.h b/src/config_struct.h index a4cf7d1..28bd87e 100644 --- a/src/config_struct.h +++ b/src/config_struct.h @@ -92,6 +92,7 @@ cfg_opt_t titlebar_opts[] = cfg_opt_t client_opts[]= { CFG_BOOL("place_at_mouse", cfg_false, CFGF_NONE), + CFG_BOOL("border_shadow", cfg_false, CFGF_NONE), CFG_INT("border_height", 1, CFGF_NONE), CFG_STR("border_normal", "#354B5C", CFGF_NONE), CFG_STR("border_focus", "#6286A1", CFGF_NONE), diff --git a/src/frame.c b/src/frame.c index 7f98616..d5c7e0c 100644 --- a/src/frame.c +++ b/src/frame.c @@ -113,10 +113,13 @@ frame_create(Client *c) c->colors.resizecorner, &at); /* Border (for shadow) */ - CWIN(c->left, c->frame, 0, 0, SHADH, c->frame_geo.height, 0, CWBackPixel, color_enlight(c->colors.frame), &at); - CWIN(c->top, c->frame, 0, 0, c->frame_geo.width, SHADH, 0, CWBackPixel, color_enlight(c->colors.frame), &at); - CWIN(c->bottom, c->frame, 0, c->frame_geo.height - SHADH, c->frame_geo.width, SHADH, 0, CWBackPixel, SHADC, &at); - CWIN(c->right, c->frame, c->frame_geo.width - SHADH, 0, SHADH, c->frame_geo.height, 0, CWBackPixel, SHADC, &at); + if(conf.client.border_shadow) + { + CWIN(c->left, c->frame, 0, 0, SHADH, c->frame_geo.height, 0, CWBackPixel, color_enlight(c->colors.frame), &at); + CWIN(c->top, c->frame, 0, 0, c->frame_geo.width, SHADH, 0, CWBackPixel, color_enlight(c->colors.frame), &at); + CWIN(c->bottom, c->frame, 0, c->frame_geo.height - SHADH, c->frame_geo.width, SHADH, 0, CWBackPixel, SHADC, &at); + CWIN(c->right, c->frame, c->frame_geo.width - SHADH, 0, SHADH, c->frame_geo.height, 0, CWBackPixel, SHADC, &at); + } /* Reparent window with the frame */ XReparentWindow(dpy, c->win, c->frame, BORDH, BORDH + TBARH); @@ -173,10 +176,13 @@ frame_moveresize(Client *c, XRectangle geo) XMoveWindow(dpy, c->resize, c->frame_geo.width - RESHW, c->frame_geo.height - RESHW); /* Border */ + if(conf.client.border_shadow) + { XResizeWindow(dpy, c->left, SHADH, c->frame_geo.height - SHADH); XResizeWindow(dpy, c->top, c->frame_geo.width, SHADH); XMoveResizeWindow(dpy, c->bottom, 0, c->frame_geo.height - SHADH, c->frame_geo.width, SHADH); XMoveResizeWindow(dpy, c->right, c->frame_geo.width - SHADH, 0, SHADH, c->frame_geo.height); + } return; } @@ -218,17 +224,22 @@ frame_update(Client *c) XSetWindowBackground(dpy, c->frame, c->colors.frame); XSetWindowBackground(dpy, c->resize, c->colors.resizecorner); - XSetWindowBackground(dpy, c->left, color_enlight(c->colors.frame)); - XSetWindowBackground(dpy, c->top, color_enlight(c->colors.frame)); - XSetWindowBackground(dpy, c->right, SHADC); - XSetWindowBackground(dpy, c->bottom, SHADC); - - XClearWindow(dpy, c->resize); XClearWindow(dpy, c->frame); - XClearWindow(dpy, c->left); - XClearWindow(dpy, c->top); - XClearWindow(dpy, c->right); - XClearWindow(dpy, c->bottom); + XClearWindow(dpy, c->resize); + + + if(conf.client.border_shadow) + { + XSetWindowBackground(dpy, c->left, color_enlight(c->colors.frame)); + XSetWindowBackground(dpy, c->top, color_enlight(c->colors.frame)); + XSetWindowBackground(dpy, c->right, SHADC); + XSetWindowBackground(dpy, c->bottom, SHADC); + + XClearWindow(dpy, c->left); + XClearWindow(dpy, c->top); + XClearWindow(dpy, c->right); + XClearWindow(dpy, c->bottom); + } if(TBARH && (TBARH + BORDH + 1) > font->height) barwin_draw_text(c->titlebar, diff --git a/src/structs.h b/src/structs.h index 339352e..3adf22d 100644 --- a/src/structs.h +++ b/src/structs.h @@ -291,6 +291,7 @@ typedef struct struct { Bool place_at_mouse; + Bool border_shadow; int borderheight; uint bordernormal; uint borderfocus; diff --git a/wmfsrc b/wmfsrc index e1b282e..9a3db1d 100644 --- a/wmfsrc +++ b/wmfsrc @@ -76,6 +76,7 @@ root client { border_height = 3 + border_shadow = true border_normal = "#191919" border_focus = "#003366" resize_corner_normal = "#191919"