From 363cefefee55cfa24af8efb56306a09f483dead8 Mon Sep 17 00:00:00 2001 From: MATSUU Takuto Date: Fri, 25 Jan 2008 23:48:24 +0100 Subject: [PATCH] transparency rule support Signed-off-by: Julien Danjou --- awesomerc.1.txt | 1 + client.c | 3 +++ config.c | 2 ++ structs.h | 1 + 4 files changed, 7 insertions(+) diff --git a/awesomerc.1.txt b/awesomerc.1.txt index 388c5b29..16d8a809 100644 --- a/awesomerc.1.txt +++ b/awesomerc.1.txt @@ -512,6 +512,7 @@ rules screen = icon = not_master = + opacity = } } keys diff --git a/client.c b/client.c index 973c98e5..9f96531e 100644 --- a/client.c +++ b/client.c @@ -285,6 +285,9 @@ client_manage(Window w, XWindowAttributes *wa, int screen) client_setfloating(c, False); break; } + + if(rule->opacity >= 0.0f) + window_settrans(c->win, rule->opacity); } else move_client_to_screen(c, screen, True); diff --git a/config.c b/config.c index 4eb0e023..6afb6511 100644 --- a/config.c +++ b/config.c @@ -644,6 +644,7 @@ config_parse(const char *confpatharg) CFG_STR((char *) "float", (char *) "auto", CFGF_NONE), CFG_INT((char *) "screen", RULE_NOSCREEN, CFGF_NONE), CFG_BOOL((char *) "not_master", cfg_false, CFGF_NONE), + CFG_FLOAT((char *) "opacity", -1.0f, CFGF_NONE), CFG_END() }; static cfg_opt_t rules_opts[] = @@ -756,6 +757,7 @@ config_parse(const char *confpatharg) rule->isfloating = rules_get_float_from_str(cfg_getstr(cfgsectmp, "float")); rule->screen = cfg_getint(cfgsectmp, "screen"); rule->not_master = cfg_getbool(cfgsectmp, "not_master"); + rule->opacity = cfg_getfloat(cfgsectmp, "opacity"); if(rule->screen >= globalconf.nscreen) rule->screen = 0; diff --git a/structs.h b/structs.h index 60f30882..9821a57f 100644 --- a/structs.h +++ b/structs.h @@ -61,6 +61,7 @@ struct Rule int screen; RuleFloat isfloating; Bool not_master; + double opacity; regex_t *prop_r; regex_t *tags_r; regex_t *xpropval_r;