From 06904cfcaac7ce9edfe34105e4c5c4fc31dc179b Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 4 Feb 2008 14:54:50 +0100 Subject: [PATCH] Revert "remove opacity_unfocused" --- awesomerc.1.txt | 1 + client.c | 4 ++++ common/configopts.c | 1 + config.c | 1 + structs.h | 2 ++ 5 files changed, 9 insertions(+) diff --git a/awesomerc.1.txt b/awesomerc.1.txt index 2e672c195..1ab129f33 100644 --- a/awesomerc.1.txt +++ b/awesomerc.1.txt @@ -338,6 +338,7 @@ screen [MULTI] font = new_become_master = new_get_focus = + opacity_unfocused = resize_hints = sloppy_focus = sloppy_focus_raise = diff --git a/client.c b/client.c index 5e1ada7b3..0370440df 100644 --- a/client.c +++ b/client.c @@ -147,6 +147,8 @@ client_updatetitle(Client *c) static void client_unfocus(Client *c) { + if(globalconf.screens[c->screen].opacity_unfocused != -1) + window_settrans(c->win, globalconf.screens[c->screen].opacity_unfocused); XSetWindowBorder(globalconf.display, c->win, globalconf.screens[c->screen].colors_normal[ColBorder].pixel); widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS); @@ -191,6 +193,8 @@ client_focus(Client *c, int screen, Bool from_mouse) { /* save sel in focus history */ focus_add_client(c); + if(globalconf.screens[c->screen].opacity_unfocused != -1) + window_settrans(c->win, globalconf.screens[screen].opacity_unfocused); XSetWindowBorder(globalconf.display, c->win, globalconf.screens[screen].colors_selected[ColBorder].pixel); XSetInputFocus(globalconf.display, c->win, RevertToPointerRoot, CurrentTime); diff --git a/common/configopts.c b/common/configopts.c index b64a5ce60..f6532c719 100644 --- a/common/configopts.c +++ b/common/configopts.c @@ -36,6 +36,7 @@ cfg_opt_t general_opts[] = CFG_BOOL((char *) "new_become_master", cfg_true, CFGF_NONE), CFG_BOOL((char *) "new_get_focus", cfg_true, CFGF_NONE), CFG_STR((char *) "font", (char *) "vera-10", CFGF_NONE), + CFG_INT((char *) "opacity_unfocused", -1, CFGF_NONE), CFG_END() }; cfg_opt_t colors_opts[] = diff --git a/config.c b/config.c index bbfea7d89..a95eadaa7 100644 --- a/config.c +++ b/config.c @@ -317,6 +317,7 @@ config_parse_screen(cfg_t *cfg, int screen) virtscreen->sloppy_focus_raise = cfg_getbool(cfg_general, "sloppy_focus_raise"); virtscreen->new_become_master = cfg_getbool(cfg_general, "new_become_master"); virtscreen->new_get_focus = cfg_getbool(cfg_general, "new_get_focus"); + virtscreen->opacity_unfocused = cfg_getint(cfg_general, "opacity_unfocused"); virtscreen->font = XftFontOpenName(globalconf.display, phys_screen, cfg_getstr(cfg_general, "font")); diff --git a/structs.h b/structs.h index f83c30939..8d932826d 100644 --- a/structs.h +++ b/structs.h @@ -270,6 +270,8 @@ typedef struct XColor colors_selected[ColLast]; /** Urgency colors */ XColor colors_urgent[ColLast]; + /** Transparency of unfocused clients */ + int opacity_unfocused; /** Tag list */ Tag *tags; /** Layout list */