win: update mode in win_on_factor_change

win_on_factor_change is called when client window changed for a frame,
in that case, the mode of the window could change.

Related: #299

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2020-04-10 04:19:53 +01:00
parent 176718ad3b
commit 660d16f555
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 3 additions and 0 deletions

View File

@ -904,6 +904,7 @@ void win_update_opacity_rule(session_t *ps, struct managed_win *w) {
* TODO need better name
*/
void win_on_factor_change(session_t *ps, struct managed_win *w) {
log_debug("Window %#010x (%s) factor change", w->base.id, w->name);
// Focus needs to be updated first, as other rules might depend on the focused
// state of the window
win_update_focused(ps, w);
@ -911,6 +912,8 @@ void win_on_factor_change(session_t *ps, struct managed_win *w) {
win_determine_shadow(ps, w);
win_determine_invert_color(ps, w);
win_determine_blur_background(ps, w);
w->mode = win_calc_mode(w);
log_debug("Window mode changed to %d", w->mode);
win_update_opacity_rule(ps, w);
if (w->a.map_state == XCB_MAP_STATE_VIEWABLE)
w->paint_excluded = c2_match(ps, w, ps->o.paint_blacklist, NULL);