win: store if transparent-clipping is enabled for window

Instead of storing if transparent-clipping is excluded for the window,
so later we don't need access `struct options::transparent_clipping`
to determine if transparent-clipping is enabled for a window.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2024-04-12 14:23:01 +01:00
parent f10903d4c3
commit 90e507d739
No known key found for this signature in database
GPG Key ID: D3A4405BE6CC17F4
3 changed files with 6 additions and 5 deletions

View File

@ -1040,7 +1040,7 @@ static bool paint_preprocess(session_t *ps, bool *fade_running, bool *animation,
// we add the window region to the ignored region
// Otherwise last_reg_ignore shouldn't change
if ((w->mode != WMODE_TRANS && !ps->o.force_win_blend) ||
(ps->o.transparent_clipping && !w->transparent_clipping_excluded)) {
w->transparent_clipping) {
// w->mode == WMODE_SOLID or WMODE_FRAME_TRANS
region_t *tmp = rc_region_new();
if (w->mode == WMODE_SOLID) {

View File

@ -1385,8 +1385,9 @@ void win_on_factor_change(session_t *ps, struct managed_win *w) {
w->fade_excluded = c2_match(ps->c2_state, w, ps->o.fade_blacklist, NULL);
w->transparent_clipping_excluded =
c2_match(ps->c2_state, w, ps->o.transparent_clipping_blacklist, NULL);
w->transparent_clipping =
ps->o.transparent_clipping &&
!c2_match(ps->c2_state, w, ps->o.transparent_clipping_blacklist, NULL);
win_update_opacity_target(ps, w);
@ -1666,7 +1667,7 @@ struct win *attr_ret_nonnull maybe_allocate_managed_win(session_t *ps, struct wi
.rounded_corners = false,
.paint_excluded = false,
.fade_excluded = false,
.transparent_clipping_excluded = false,
.transparent_clipping = false,
.unredir_if_possible_excluded = false,
.prop_shadow = -1,
// following 4 are set in win_mark_client

View File

@ -240,7 +240,7 @@ struct managed_win {
bool fade_excluded;
/// Whether transparent clipping is excluded by the rules.
bool transparent_clipping_excluded;
bool transparent_clipping;
// Frame-opacity-related members
/// Current window frame opacity. Affected by window opacity.