win: win_update_opacity_prop doesn't take session_t anymore

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2024-02-19 22:09:01 +00:00
parent 23455296fa
commit 56af75c5e0
No known key found for this signature in database
GPG Key ID: D3A4405BE6CC17F4
1 changed files with 8 additions and 6 deletions

View File

@ -66,7 +66,8 @@ static int win_update_name(struct x_connection *c, struct atom *atoms, struct ma
/** /**
* Reread opacity property of a window. * Reread opacity property of a window.
*/ */
static void win_update_opacity_prop(session_t *ps, struct managed_win *w); static void win_update_opacity_prop(struct x_connection *c, struct atom *atoms,
struct managed_win *w, bool detect_client_opacity);
static void win_update_opacity_target(session_t *ps, struct managed_win *w); static void win_update_opacity_target(session_t *ps, struct managed_win *w);
/** /**
* Retrieve frame extents from a window. * Retrieve frame extents from a window.
@ -455,7 +456,7 @@ static void win_update_properties(session_t *ps, struct managed_win *w) {
} }
if (win_fetch_and_unset_property_stale(w, ps->atoms->a_NET_WM_WINDOW_OPACITY)) { if (win_fetch_and_unset_property_stale(w, ps->atoms->a_NET_WM_WINDOW_OPACITY)) {
win_update_opacity_prop(ps, w); win_update_opacity_prop(&ps->c, ps->atoms, w, ps->o.detect_client_opacity);
// we cannot receive OPACITY change when window has been destroyed // we cannot receive OPACITY change when window has been destroyed
assert(w->state != WSTATE_DESTROYING); assert(w->state != WSTATE_DESTROYING);
win_update_opacity_target(ps, w); win_update_opacity_target(ps, w);
@ -2044,24 +2045,25 @@ void win_update_bounding_shape(session_t *ps, struct managed_win *w) {
/** /**
* Reread opacity property of a window. * Reread opacity property of a window.
*/ */
void win_update_opacity_prop(session_t *ps, struct managed_win *w) { void win_update_opacity_prop(struct x_connection *c, struct atom *atoms,
struct managed_win *w, bool detect_client_opacity) {
// get frame opacity first // get frame opacity first
w->has_opacity_prop = w->has_opacity_prop =
wid_get_opacity_prop(&ps->c, ps->atoms, w->base.id, OPAQUE, &w->opacity_prop); wid_get_opacity_prop(c, atoms, w->base.id, OPAQUE, &w->opacity_prop);
if (w->has_opacity_prop) { if (w->has_opacity_prop) {
// opacity found // opacity found
return; return;
} }
if (ps->o.detect_client_opacity && w->client_win && w->base.id == w->client_win) { if (detect_client_opacity && w->client_win && w->base.id == w->client_win) {
// checking client opacity not allowed // checking client opacity not allowed
return; return;
} }
// get client opacity // get client opacity
w->has_opacity_prop = w->has_opacity_prop =
wid_get_opacity_prop(&ps->c, ps->atoms, w->client_win, OPAQUE, &w->opacity_prop); wid_get_opacity_prop(c, atoms, w->client_win, OPAQUE, &w->opacity_prop);
} }
/** /**