1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-11-11 13:51:02 -05:00

backend: gl: don't fill window with big border_width

If a window's border_width is bigger than its corner_radius, the inner
radius of the border become less than 0, causing the entire window to be
filled.

Fixes #778

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2022-02-10 07:47:48 +00:00
parent 01649b68b9
commit ea2ba58efd
No known key found for this signature in database
GPG key ID: D3A4405BE6CC17F4

View file

@ -395,7 +395,11 @@ static void _gl_compose(backend_t *base, struct backend_image *img, GLuint targe
glUniform1f(gd->win_shader.uniform_corner_radius, (float)img->corner_radius);
}
if (gd->win_shader.uniform_border_width >= 0) {
glUniform1f(gd->win_shader.uniform_border_width, (float)img->border_width);
auto border_width = img->border_width;
if (border_width > img->corner_radius) {
border_width = 0;
}
glUniform1f(gd->win_shader.uniform_border_width, (float)border_width);
}
// log_trace("Draw: %d, %d, %d, %d -> %d, %d (%d, %d) z %d\n",