Partially handle _NET_WM_BYPASS_COMPOSITOR

Unredirect the screen when some window sets _NET_WM_BYPASS_COMPOSITOR
to 1, but ignore the case where some window requests the screen to be
redirected by setting _NET_WM_BYPASS_COMPOSITOR to 2.

Closes #267

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2020-01-18 18:00:35 +00:00
parent c9417bf367
commit b026708026
5 changed files with 47 additions and 1 deletions

View File

@ -2251,6 +2251,8 @@ static inline bool rect_is_fullscreen(const session_t *ps, int x, int y, int wid
/**
* Check if a window is fulscreen using EWMH
*
* TODO cache this property
*/
static inline bool
win_is_fullscreen_xcb(xcb_connection_t *c, const struct atom *a, const xcb_window_t w) {
@ -2312,6 +2314,25 @@ bool win_is_fullscreen(const session_t *ps, const struct managed_win *w) {
(!w->bounding_shaped || w->rounded_corners);
}
/**
* Check if a window has BYPASS_COMPOSITOR property set
*
* TODO cache this property
*/
bool win_is_bypassing_compositor(const session_t *ps, const struct managed_win *w) {
bool ret = false;
auto prop = x_get_prop(ps, w->client_win, ps->atoms->a_NET_WM_BYPASS_COMPOSITOR,
1L, XCB_ATOM_CARDINAL, 32);
if (prop.nitems && *prop.c32 == 1) {
ret = true;
}
free_winprop(&prop);
return ret;
}
/**
* Check if a window is really focused.
*/