Skip to content

Commit

Permalink
gl: fix for correct display of window borders during animation
Browse files Browse the repository at this point in the history
  • Loading branch information
Monsterovich committed Jul 20, 2024
1 parent 2dc2188 commit d269d12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions src/opengl.c
Original file line number Diff line number Diff line change
Expand Up @@ -797,10 +797,7 @@ bool glx_bind_pixmap(session_t *ps, glx_texture_t **pptex, xcb_pixmap_t pixmap,

glTexParameteri(ptex->target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(ptex->target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
if (repeat) {
glTexParameteri(ptex->target, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(ptex->target, GL_TEXTURE_WRAP_T, GL_REPEAT);
} else {
if (!repeat) {
glTexParameteri(ptex->target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(ptex->target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
}
Expand Down
6 changes: 3 additions & 3 deletions src/render.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ void paint_one(session_t *ps, struct win *w, const region_t *reg_paint) {
// Let glx_bind_pixmap() determine pixmap size, because if the user
// is resizing windows, the width and height we get may not be up-to-date,
// causing the jittering issue M4he reported in #7.
if (!paint_bind_tex(ps, &w->paint, 0, 0, false, 0, w->a.visual,
if (!paint_bind_tex(ps, &w->paint, 0, 0, true, 0, w->a.visual,
(!ps->o.glx_no_rebind_pixmap && w->pixmap_damaged))) {
log_error("Failed to bind texture for window %#010x.", win_id(w));
}
Expand Down Expand Up @@ -763,7 +763,7 @@ static bool win_build_shadow(session_t *ps, struct win *w, double opacity) {
*/
static inline void win_paint_shadow(session_t *ps, struct win *w, region_t *reg_paint) {
// Bind shadow pixmap to GLX texture if needed
paint_bind_tex(ps, &w->shadow_paint, 0, 0, false, 32, 0, false);
paint_bind_tex(ps, &w->shadow_paint, 0, 0, true, 32, 0, false);

if (!paint_isvalid(ps, &w->shadow_paint)) {
log_error("Window %#010x is missing shadow data.", win_id(w));
Expand Down Expand Up @@ -1288,7 +1288,7 @@ void paint_all(session_t *ps, struct win *t) {
glXWaitX();
assert(ps->tgt_buffer.pixmap);
paint_bind_tex(ps, &ps->tgt_buffer, ps->root_width, ps->root_height,
false, ps->c.screen_info->root_depth,
true, ps->c.screen_info->root_depth,
ps->c.screen_info->root_visual, !ps->o.glx_no_rebind_pixmap);
if (ps->o.vsync_use_glfinish) {
glFinish();
Expand Down

0 comments on commit d269d12

Please sign in to comment.