win: fix transparency detection

Previously, when frame_opacity is < 1, we consider windows with frames to be
WIN_FRAME_TRANS immediately, without even checking if the body of the window
is transparent. The result is a transparent window is seen as a opaque window
with only a transparent frame, causing its background to not be blurred.

Fixes #211
This commit is contained in:
Yuxuan Shui 2020-03-11 21:00:47 +00:00
parent d757d45d1e
commit 93f89b8603
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 4 additions and 3 deletions

View File

@ -553,9 +553,6 @@ winmode_t win_calc_mode(const struct managed_win *w) {
if (w->opacity < 1.0) { if (w->opacity < 1.0) {
return WMODE_TRANS; return WMODE_TRANS;
} }
if (w->frame_opacity != 1.0 && win_has_frame(w)) {
return WMODE_FRAME_TRANS;
}
if (win_has_alpha(w)) { if (win_has_alpha(w)) {
if (w->client_win == XCB_NONE) { if (w->client_win == XCB_NONE) {
@ -578,6 +575,10 @@ winmode_t win_calc_mode(const struct managed_win *w) {
// consider the window solid // consider the window solid
} }
if (w->frame_opacity != 1.0 && win_has_frame(w)) {
return WMODE_FRAME_TRANS;
}
// log_trace("Window %#010x(%s) is solid", w->client_win, w->name); // log_trace("Window %#010x(%s) is solid", w->client_win, w->name);
return WMODE_SOLID; return WMODE_SOLID;
} }