Add wintype option `redir-ignore`.

This cause certain window types to be ignored in deciding whether the
screen should be redirected after being unredirected.

Fixes #58

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2018-12-04 15:30:07 +00:00
parent 8f05b03411
commit f83eb79c05
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
4 changed files with 19 additions and 5 deletions

View File

@ -389,6 +389,9 @@ Following per window-type options are available: ::
full-shadow::: full-shadow:::
Controls whether shadow is drawn under the parts of the window that you normally won't be able to see. Useful when the window has parts of it transparent, and you want shadows in those areas. Controls whether shadow is drawn under the parts of the window that you normally won't be able to see. Useful when the window has parts of it transparent, and you want shadows in those areas.
redir-ignore:::
Controls whether this type window should cause screen to become redirected again after been unredirected. If you have *--unredir-if-possible* set, and doesn't want certain window to cause unnecessary screen redirection, you can set this to `true`.
SIGNALS SIGNALS
------- -------

View File

@ -1333,7 +1333,12 @@ paint_preprocess(session_t *ps, win *list) {
w->flags = 0; w->flags = 0;
w->prev_trans = t; w->prev_trans = t;
t = w; t = w;
is_highest = false;
// If the screen is not redirected and the window has redir_ignore set,
// this window should not cause the screen to become redirected
if (!(ps->o.wintype_option[w->window_type].redir_ignore && !ps->redirected)) {
is_highest = false;
}
skip_window: skip_window:
reg_ignore_valid = reg_ignore_valid && w->reg_ignore_valid; reg_ignore_valid = reg_ignore_valid && w->reg_ignore_valid;
@ -1375,8 +1380,7 @@ paint_preprocess(session_t *ps, win *list) {
ev_timer_start(ps->loop, &ps->unredir_timer); ev_timer_start(ps->loop, &ps->unredir_timer);
} }
} }
} } else {
else {
ev_timer_stop(ps->loop, &ps->unredir_timer); ev_timer_stop(ps->loop, &ps->unredir_timer);
redir_start(ps); redir_start(ps);
} }

View File

@ -376,6 +376,10 @@ void parse_config(session_t *ps, bool *shadow_enable, bool *fading_enable,
winopt_mask[i].full_shadow = true; winopt_mask[i].full_shadow = true;
ps->o.wintype_option[i].full_shadow = false; ps->o.wintype_option[i].full_shadow = false;
} }
if (!winopt_mask[i].redir_ignore) {
winopt_mask[i].redir_ignore = true;
ps->o.wintype_option[i].redir_ignore = false;
}
if (!winopt_mask[i].opacity) { if (!winopt_mask[i].opacity) {
winopt_mask[i].opacity = true; winopt_mask[i].opacity = true;
// Opacity is not set to a concrete number here because the opacity logic // Opacity is not set to a concrete number here because the opacity logic

View File

@ -260,8 +260,7 @@ void parse_config_libconfig(session_t *ps, bool *shadow_enable,
// -m (menu_opacity) // -m (menu_opacity)
if (config_lookup_float(&cfg, "menu-opacity", &dval)) { if (config_lookup_float(&cfg, "menu-opacity", &dval)) {
printf_errf("(): option `menu-opacity` is deprecated, and will be removed.\n" printf_errf("(): option `menu-opacity` is deprecated, and will be removed.\n"
"Please use the wintype option `opacity` of `popup_menu` and\n" "Please use the wintype option `opacity` of `popup_menu` and `dropdown_menu` instead.");
"`dropdown_menu` instead.");
ps->o.wintype_option[WINTYPE_DROPDOWN_MENU].opacity = dval; ps->o.wintype_option[WINTYPE_DROPDOWN_MENU].opacity = dval;
ps->o.wintype_option[WINTYPE_POPUP_MENU].opacity = dval; ps->o.wintype_option[WINTYPE_POPUP_MENU].opacity = dval;
winopt_mask[WINTYPE_DROPDOWN_MENU].opacity = true; winopt_mask[WINTYPE_DROPDOWN_MENU].opacity = true;
@ -420,6 +419,10 @@ void parse_config_libconfig(session_t *ps, bool *shadow_enable,
o->full_shadow = ival; o->full_shadow = ival;
mask->full_shadow = true; mask->full_shadow = true;
} }
if (config_setting_lookup_bool(setting, "redir-ignore", &ival)) {
o->redir_ignore = ival;
mask->redir_ignore = true;
}
double fval; double fval;
if (config_setting_lookup_float(setting, "opacity", &fval)) { if (config_setting_lookup_float(setting, "opacity", &fval)) {