Rename wintype "notify" to "notification"
"notify" is the only wintype that has a name inconsistent with its Xorg name. So fix that. Compatibility code is added as well, so the old "notify" wintype name still works. Fixes #323 Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
c59b0bca22
commit
7817f52cb1
|
@ -361,7 +361,7 @@ wintypes:
|
||||||
};
|
};
|
||||||
------------
|
------------
|
||||||
|
|
||||||
'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard: "unknown", "desktop", "dock", "toolbar", "menu", "utility", "splash", "dialog", "normal", "dropdown_menu", "popup_menu", "tooltip", "notify", "combo", and "dnd".
|
'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard: "unknown", "desktop", "dock", "toolbar", "menu", "utility", "splash", "dialog", "normal", "dropdown_menu", "popup_menu", "tooltip", "notification", "combo", and "dnd".
|
||||||
|
|
||||||
Following per window-type options are available: ::
|
Following per window-type options are available: ::
|
||||||
|
|
||||||
|
|
|
@ -250,6 +250,43 @@ parse_cfg_condlst_opct(options_t *opt, const config_t *pcfg, const char *name) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void parse_wintype_config(const config_t *cfg, const char *member_name,
|
||||||
|
win_option_t *o, win_option_mask_t *mask) {
|
||||||
|
char *str = mstrjoin("wintypes.", member_name);
|
||||||
|
const config_setting_t *setting = config_lookup(cfg, str);
|
||||||
|
free(str);
|
||||||
|
|
||||||
|
int ival = 0;
|
||||||
|
if (setting) {
|
||||||
|
if (config_setting_lookup_bool(setting, "shadow", &ival)) {
|
||||||
|
o->shadow = ival;
|
||||||
|
mask->shadow = true;
|
||||||
|
}
|
||||||
|
if (config_setting_lookup_bool(setting, "fade", &ival)) {
|
||||||
|
o->fade = ival;
|
||||||
|
mask->fade = true;
|
||||||
|
}
|
||||||
|
if (config_setting_lookup_bool(setting, "focus", &ival)) {
|
||||||
|
o->focus = ival;
|
||||||
|
mask->focus = true;
|
||||||
|
}
|
||||||
|
if (config_setting_lookup_bool(setting, "full-shadow", &ival)) {
|
||||||
|
o->full_shadow = ival;
|
||||||
|
mask->full_shadow = true;
|
||||||
|
}
|
||||||
|
if (config_setting_lookup_bool(setting, "redir-ignore", &ival)) {
|
||||||
|
o->redir_ignore = ival;
|
||||||
|
mask->redir_ignore = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
double fval;
|
||||||
|
if (config_setting_lookup_float(setting, "opacity", &fval)) {
|
||||||
|
o->opacity = normalize_d(fval);
|
||||||
|
mask->opacity = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse a configuration file from default location.
|
* Parse a configuration file from default location.
|
||||||
*
|
*
|
||||||
|
@ -604,41 +641,13 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad
|
||||||
|
|
||||||
// XXX ! Refactor all the wintype_* arrays into a struct
|
// XXX ! Refactor all the wintype_* arrays into a struct
|
||||||
for (wintype_t i = 0; i < NUM_WINTYPES; ++i) {
|
for (wintype_t i = 0; i < NUM_WINTYPES; ++i) {
|
||||||
char *str = mstrjoin("wintypes.", WINTYPES[i]);
|
parse_wintype_config(&cfg, WINTYPES[i], &opt->wintype_option[i],
|
||||||
config_setting_t *setting = config_lookup(&cfg, str);
|
&winopt_mask[i]);
|
||||||
free(str);
|
|
||||||
|
|
||||||
win_option_t *o = &opt->wintype_option[i];
|
|
||||||
win_option_mask_t *mask = &winopt_mask[i];
|
|
||||||
if (setting) {
|
|
||||||
if (config_setting_lookup_bool(setting, "shadow", &ival)) {
|
|
||||||
o->shadow = ival;
|
|
||||||
mask->shadow = true;
|
|
||||||
}
|
|
||||||
if (config_setting_lookup_bool(setting, "fade", &ival)) {
|
|
||||||
o->fade = ival;
|
|
||||||
mask->fade = true;
|
|
||||||
}
|
|
||||||
if (config_setting_lookup_bool(setting, "focus", &ival)) {
|
|
||||||
o->focus = ival;
|
|
||||||
mask->focus = true;
|
|
||||||
}
|
|
||||||
if (config_setting_lookup_bool(setting, "full-shadow", &ival)) {
|
|
||||||
o->full_shadow = ival;
|
|
||||||
mask->full_shadow = true;
|
|
||||||
}
|
|
||||||
if (config_setting_lookup_bool(setting, "redir-ignore", &ival)) {
|
|
||||||
o->redir_ignore = ival;
|
|
||||||
mask->redir_ignore = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double fval;
|
// Compatibility with the old name for notification windows.
|
||||||
if (config_setting_lookup_float(setting, "opacity", &fval)) {
|
parse_wintype_config(&cfg, "notify", &opt->wintype_option[WINTYPE_NOTIFICATION],
|
||||||
o->opacity = normalize_d(fval);
|
&winopt_mask[WINTYPE_NOTIFICATION]);
|
||||||
mask->opacity = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
config_destroy(&cfg);
|
config_destroy(&cfg);
|
||||||
return path;
|
return path;
|
||||||
|
|
|
@ -78,7 +78,7 @@ static void unredirect(session_t *ps);
|
||||||
const char *const WINTYPES[NUM_WINTYPES] = {
|
const char *const WINTYPES[NUM_WINTYPES] = {
|
||||||
"unknown", "desktop", "dock", "toolbar", "menu",
|
"unknown", "desktop", "dock", "toolbar", "menu",
|
||||||
"utility", "splash", "dialog", "normal", "dropdown_menu",
|
"utility", "splash", "dialog", "normal", "dropdown_menu",
|
||||||
"popup_menu", "tooltip", "notify", "combo", "dnd",
|
"popup_menu", "tooltip", "notification", "combo", "dnd",
|
||||||
};
|
};
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
|
Loading…
Reference in New Issue